kschlesselmann
02/14/2022, 11:36 AMFlux.just(…).flatMap { someAsnyStuff(it) }.subscribe()
would be with a Flow? It seems that myFlow.flatMapMerge { someSuspendingStuff(it) }.collect()
does not result in the same concurrency/throughput 😕Joffrey
02/14/2022, 11:39 AMsomeSuspendingStuff
if it switches contextkschlesselmann
02/14/2022, 11:40 AMJoffrey
02/14/2022, 11:42 AMmyFlow.flatMapMerge { flowOf(someSuspendingStuff(it)) }.collect()
.
This would make the collection of each element concurrent. But if you're after parallelism what I'm saying is that it will depend on the coroutine scope in which you're running this, and also depends on what's inside someSuspendingStuff
.kschlesselmann
02/14/2022, 11:43 AM