Is there any "guide" on knowing which scope to pic...
# coroutines
n
Is there any "guide" on knowing which scope to pick when launching a coroutine? I'm not sure what exactly I should be basing that decision off of. For example, if I'm launching something that isn't directly relevant to a lifecycle, should I only use
GlobalScope
, or should I use the most localized scope I can, just so the processes stay organized?
d
Make that decision based on the parent the coroutine should have, such that errors that occur cancel the right parent and vice versa, and which dispatcher it should use. It depends on the context.