wfisher
06/29/2017, 9:21 PMAfter
is always printed even though it shouldn't be.
fun main(args: Array<String>) = runBlocking<Unit> {
launch(CommonPool) {
while (true) {
withTimeoutOrNull(500) {
println("Before")
blockingFn()
println("After")
}
}
}
delay(10000)
}
fun blockingFn() {
Thread.sleep(2000)
}