julioyg
01/30/2019, 4:27 PMgildor
01/30/2019, 4:40 PMjulioyg
01/30/2019, 4:40 PMisClosedForReceive
it's false
...fun main() {
var channel: ReceiveChannel<String>? = null
var broadcastChannel = BroadcastChannel<String>(1)
val job = GlobalScope.launch {
channel = broadcastChannel.openSubscription()
}
job.cancel()
Thread.sleep(1000)
println("is closed ${channel!!.isClosedForReceive}")
}
false
Allan Wang
01/30/2019, 6:45 PMjulioyg
01/30/2019, 7:21 PMconsumeEach
thanks bot for the helpBroadcastChannel
so when you call openSubscription
it creates a new channel, so (reading the github issue) even if you close the channel returned by openSubscription
you can still send items to the BroadcastChannel