tseisel
03/11/2020, 4:44 PMCoroutineScope
that is a child of another ?
What I tried:
val parentScope = ...
val childScope = parentScope + SupervisorJob()
parentScope.cancel()
parentScope.isActive // false
childScope.isActive // true (!!)
It seems that cancelling the parent does not cancel its children. I guess I'm missing something here...bezrukov
03/11/2020, 4:49 PMval childScope = parentScope + SupervisorJob(parentScope.coroutineContext[Job])
Javier Troconis
03/11/2020, 5:01 PMbezrukov
03/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 Troconis
03/11/2020, 5:28 PMtseisel
03/11/2020, 7:24 PMbezrukov
03/11/2020, 7:47 PM