I have a object list that is processed using paral...
# coroutines
a
I have a object list that is processed using parallelstream. How can I migrate this to corroutine?
b
You need buffered channel with multiple consumer coroutines
In short: • Parallel -> Channel • Concurrent -> Flow
j
It depends on the size of the collection you're processing, what you need to do with the elements. Do you have example code? For instance, a parallel map for a collection that is not unreasonably large can be done this way (if the current dispatcher is multithreaded):
Copy code
val result = coroutineScope {
    list.map {
        async { tranformElement(it) }
    }.awaitAll()
}