Justin Tullgren
01/21/2022, 4:27 PMChannel.receiveAsFlow
can process individual items in parallel by collectors? Or is it an internal "fan out". I just want to process a queue of emissions in parallel. Thanks!
val flow = channel.receiveAsFlow()
repeat(5) { launch { flow.collect { /*receive channel item in separate coroutine */ } } }
Nick Allen
01/23/2022, 12:20 AMrepeat(5) { launch { channel.consumeEach { /*receive channel item in separate coroutine */ } } }
Items are processed concurrently, not sequentially.Stylianos Gakis
01/24/2022, 11:32 AMJustin Tullgren
01/24/2022, 2:32 PM