Olivier Laforest
04/08/2021, 12:39 AMMonoK.fx {
//comprehension block
}.value()
that we use to be able to do in Arrow 0.11.0 in Arrow 0.13.x?simon.vergauwen
04/08/2021, 7:39 AMsuspend fun comprehensions(): A {
val mono1 = one.await()
val mono2 = two.await()
computeA(mono1, mono2).await()
}
fun monoProgram(): Mono<A> =
mono { comprehensions() }
This is useful because here await
will check for cancellation just like flatMap
does in Reactor, or bind
did in fx
.
If you don't care about cancellation, and/or don't want to include the whole KotlinX Coroutines dependency I could help set-up non-KotlinX Coroutines based DSL that achieves the same 🙂