Open hantsy opened 1 year ago
/cc @heubeck
Thank you for pointing this out, @hantsy. Mutiny-Kotlin was created before Mutiny switched to the Publisher API.
Will have a look and probably propose a refactoring.
The JDK9 extension also includes a asFlow
fun, I have tried here
https://github.com/hantsy/quarkus-sandbox/blob/master/mongodb-kotlin-co/src/main/kotlin/com/example/PostResources.kt#L4
and
https://github.com/hantsy/quarkus-sandbox/blob/master/mongodb-kotlin-co/src/main/kotlin/com/example/PostResources.kt#L28
it works.
lets follow up on this discussion in https://github.com/smallrye/smallrye-mutiny/issues/1325
Kotlinx coroutines Reactive includes an general extension fun to convert
Publisher
to Kotlin Flow, https://github.com/Kotlin/kotlinx.coroutines/blob/master/reactive/kotlinx-coroutines-reactive/src/ReactiveFlow.ktBesides add extensions to general ReactiveStreams API, https://github.com/Kotlin/kotlinx.coroutines/tree/master/reactive it also supports Reactor, Rxjava2/3, JDK 9 Flow API.
But in these implementations, it does requires a
suspend
modifier for fun.asFlow
.