Greg Stepniewski08/30/2019, 7:57 AM
If a coroutine encounters exception other than CancellationException, it cancels its parent with that exception. This behaviour cannot be overridden and is used to provide stable coroutines hierarchies for structured concurrency.However, you have SupervisorJob which says
A failure or cancellation of a child does not cause the supervisor job to fail and does not affect its other children.These two seem to contradict, since SupervisorJob clearly overrides the behaviour of children cancelling their parent on failure - or am I missing something?
Can Orhan08/30/2019, 8:03 AM
does, however, make this distinction explicit
By default, a failure of any of the job's children leads to an immediate failure of its parent and cancellation of the rest of its children. This behavior can be customized using SupervisorJob.
Matej Drobnič08/30/2019, 8:05 AM
Greg Stepniewski08/30/2019, 8:05 AM
Can Orhan08/30/2019, 8:15 AM
streetsofboston08/30/2019, 12:13 PM