What's the right way for setting off a 'fire and f...
# coroutines
o
What's the right way for setting off a 'fire and forget' Job via
launch
? Should I just instance a new scope for the call? Documentation says that any uncaught exceptions will cancel the parent job.
z
you can use
GlobalScope
if you aren’t interested in tracking its Job for cancellation
d
sorry
o
Okay, that's what I was wondering, thanks.
n
Uncaught exceptions will cancel a parent job unless it's a
SupervisorJob
, I believe
đź‘Ť 1
b
GlobalScope
behaves similarly to a supervisor scope by virtue of there being no
Job
attached to cancel peers when an uncaught exception occurs
s
GlobalScope.launch { println(this.coroutineContext[Job]) }
it still has a Job but job has no parent
d
He meant that theres no parent attached to the GlobalScope, I.e. no parent to the coroutine