question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expand Kotlin "coroutines and Mutiny" documentation

See original GitHub issue

Description

Presently, the Kotlin guide includes a small section about using coroutines: “Kotlin coroutines and Mutiny”. However, the linked mutiny-kotlin documentation only describes the extension functions, not how to use coroutines with Kotlin.

Kotlin coroutines provide a imperative programming model that actually gets executed in an asynchronous, reactive manner. To simplify the interoperation between Mutiny and Kotlin there is the module io.smallrye.reactive:mutiny-kotlin, described here.

After fiddling around with the getting-started project, I was able to use coroutines (suspend fun) by switching to “reactive” libraries:

  • quarkus-resteasy-reactive instead of quarkus-resteasy
  • quarkus-resteasy-reactive-jackson instead of quarkus-resteasy-jackson
  • io.smallrye.reactive:mutiny-kotlin instead of io.quarkus:quarkus-resteasy-mutiny
  • potentially others?

Implementation ideas

Provide a minimal Kotlin coroutines example; or, make clear what dependencies, configuration, and code (if applicable) is required to use coroutines in your application.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
geoandcommented, Nov 25, 2021

Closing this as it seems to be covered by https://github.com/quarkusio/quarkus/pull/21416

2reactions
cescoffiercommented, Nov 16, 2021

We are recommending RestEasy reactive. See https://quarkus.io/blog/resteasy-reactive-smart-dispatch/.

RestEasy is still supported, but the reactive variant provides more features.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin coroutines integration - SmallRye Mutiny
The module mutiny-kotlin provides an integration with Kotlin coroutines. There are currently four extension methods available for converting between Mutiny ...
Read more >
Use Kotlin coroutines with lifecycle-aware components
Kotlin coroutines provide an API that enables you to write asynchronous code. With Kotlin coroutines, you can define a CoroutineScope , which helps...
Read more >
kotlin - Creating `Uni` from a coroutine / suspending function
Accepting a CoroutineScope as receiver means the caller of the method can choose the scope of this coroutine, which will automatically cancel ...
Read more >
Quarkus - Reactive programming without callback headache
Tagged with quarkus, performance, kotlin, coroutines. ... Refer to Mutiny's documentation for more informations about coroutines support: ...
Read more >
Creating a Reactive CRUD todo app with Kotlin, MongoDB ...
Here is our TodoList entity with its companion objects containing the different reactive methods provided by smallrye-mutiny. Mixing the two worlds of conscise ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found