July 2018
Intermediate to advanced
266 pages
7h 11m
English
If the channel is open and it's not full, offer() will add the element to the queue. This is the only way to add elements to a channel without it happening from a suspending computation:
val channel = Channel<Int>(1)channel.offer(2) // truechannel.receive() // 2
Read now
Unlock full access