tseisel03/11/2020, 4:44 PM
that is a child of another ? What I tried:
It seems that cancelling the parent does not cancel its children. I guess I'm missing something here...
val parentScope = ... val childScope = parentScope + SupervisorJob() parentScope.cancel() parentScope.isActive // false childScope.isActive // true (!!)
bezrukov03/11/2020, 4:49 PM
val childScope = parentScope + SupervisorJob(parentScope.coroutineContext[Job])
Javier Troconis03/11/2020, 5:01 PM
bezrukov03/11/2020, 5:14 PM
* If [parent] job is specified, then this supervisor job becomes a child job of its parent and is cancelled when its parent fails or is cancelled. All this supervisor's children are cancelled in this case, too. The invocation of [cancel][Job.cancel] with exception (other than [CancellationException]) on this supervisor job also cancels parent.
Javier Troconis03/11/2020, 5:28 PM
tseisel03/11/2020, 7:24 PM
bezrukov03/11/2020, 7:47 PM