BTW, how do I limit the number of concurrent child...
# coroutines
v
BTW, how do I limit the number of concurrent children my coroutine might have? The suggested way of using a limited thread pool can't be used as-is since I have to use the parent context to have the parent-child relationship.
Copy code
fun main(args: Array<String>) = runBlocking {
    (0..100).forEach { 
         launch(coroutineContext) {   // <- limit the number of concurrent threads ?
             mySuspendingTask() 
         } 
    }
}
e
launching coroutines could not and should not suspend. The “worker pool” pattern works the other way around. You launch a fixed number of coroutines and then they all together produce the same channel.
👍 1