uhe
03/23/2017, 2:26 PMfun main(args: Array<String>): Unit = runBlocking<Unit> {
val channel = produce<Int>(context) {
delay(1000)
send(42)
}
val number = try {
withTimeout(500) { channel.receive() }
} catch (e: CancellationException) {
23
}
println(number) // prints 23
}