Of course, you'll still need to join() all the `la...
# coroutines
d
Of course, you'll still need to join() all the `launch`es to wait for the processing to be done
Copy code
fun launchProcessor(id: Int, channel: ReceiveChannel<Int>) = launch {
    channel.consumeEach {
        println("Processor #$id received $it")
    }    
}

val jobs = mutableList<Job>()
val noOfParallelTasks = 5
repeat(noOfParallelTasks) { jobs += launchProcessor(it, channel) }

jobs.forEach { it.join() }
@elect