https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Alexjok

07/14/2019, 8:27 PM
it is possible with simple pipeline? Without adding channels and etc
o

octylFractal

07/14/2019, 8:33 PM
a

Alexjok

07/14/2019, 8:48 PM
Thx
g

gildor

07/14/2019, 11:22 PM
It's also possible without Flow and Channels
Just chunked, and process each chunk sequentially, do flatMap and inside run 1 coroutine on each item and awaitAll for them
I mean something like this (just change WORKERS_COUNT and check execution time): https://pl.kotl.in/qjzAuOUmO
👍 1
Or it can be extracted to some more generic function: https://pl.kotl.in/_tA6hVRRa
👍 2
a

Alexjok

07/15/2019, 7:54 AM
@gildor yes, this is what I need! Thx
8 Views