lhwdev
06/23/2021, 5:30 AMcoroutineScope
that will be cancelled if other things in it are completed? Normally tasks running in launch
in it will cause coroutineScope
not to return.ephemient
06/23/2021, 6:12 AMrunBlocking {
val job = Job()
launch(job) {
while (true) yield()
}
launch(job) {
delay(5_000)
}
delay(100)
job.cancel()
}
// done in 100ms
lhwdev
06/23/2021, 6:13 AMephemient
06/23/2021, 2:45 PM