Cody Mikol
06/07/2021, 4:16 PMMono / Flux to Either / Validated ? I find the suspended handling of parZip / parTraverse to be much more intuitive than the Webflux functionalitiesstojan
06/07/2021, 4:52 PMsimon.vergauwen
06/17/2021, 10:17 AMsuspen fun <A> Mono<A>.toEither(): Either<Throwable, A?> =
Either.catch {
awaitSingleOrNull()
}
For Flux you could do the same but with collectList or take etc since need to deal somehow with how many elements you'd want to collect from the Flux to have it completed correctly.simon.vergauwen
06/17/2021, 10:18 AMparZip to Flow and you could work with Flux / Flow iteropt so you can keep treating it as a stream without waiting until completion inside suspend