i’m trying to use a reactor enabled async library ...
# coroutines
n
i’m trying to use a reactor enabled async library with kotlin coroutines. So far i’ve been able to provide
await()
extension for CompletableFuture and been able to use
Mono
results. What do I do for
Flux
results? How can the results be collected in a list asynchronously on a Publisher interface?
s
Would the use of Coroutines'
Flow
api work for you?
g
Have you seen that kotlinx.coroutines has reactive streams adapter library? Maybe you need something like this: https://github.com/Kotlin/kotlinx.coroutines/blob/master/reactive/kotlinx-coroutines-reactive/src/Channel.kt#L24
There is no operator to collect all values of stream to list, but instead you can use: flux.collectList().await()