import kotlinx.coroutines.* import kotlinx.coroutines.channels.* fun main() = runBlocking { val c = Channel(capacity = 2) c.send(1) c.send(2) println(c.receive()) println(c.receive()) }