ansman
08/31/2020, 3:56 PMbezrukov
08/31/2020, 5:28 PMansman
08/31/2020, 5:29 PMensureActive()
after my withContext
since I don't think it'll throw if the job has been cancelled during the delaybezrukov
08/31/2020, 5:32 PMansman
08/31/2020, 5:45 PMrunBlocking {
val parent = Job()
val child = launch {
withContext(parent) {
delay(100L)
}
println("After")
}
delay(50L)
child.cancel()
}
This code still prints afterensureActive()
before println
it works as expectedbezrukov
08/31/2020, 5:50 PMansman
08/31/2020, 5:50 PM