pdegand
06/11/2018, 11:00 PMrunBlocking {
val channel = produce(capacity = Channel.CONFLATED) {
(0..3).forEach {
println("Send $it")
send(it)
delay(100)
}
}
channel.consumeEach {
println("Consume $it")
delay(500)
}
}
and the result is
Send 0
Consume 0
Send 1
Send 2
Send 3
I expected 3 to be consumed as well as it's the last value pushed into the channel but I can't figure out why it's note getting consumed. Any help ?
Thanks