Hey there. What is the best co-routine way to proc...
# announcements
d
Hey there. What is the best co-routine way to process n batches in parallel? For each batch I need to make a remote call. It's okay if one of batches fails. Do I want to take a look into flows?
z
You could use Flow (flatMap takes a concurrency parameter). You could also just use a semaphore and launch coroutines yourself. You could also use a worker pool (launch n coroutines all reading from the same channel)
d
Hehe that pretty much confirms the impression I got from reading the co-routine chapter. Differentr ways and not sure which one to choose when