Are there any valid use cases for passing your own
Job()
object to
launch
or
async
? For most use cases, its better to launch them in another scope or use
superVisorScope{}
if you want to use
SupervisorJob
, right?
g
gildor
08/03/2020, 8:10 AM
there are some use cases, after all this what all standard coroutine builders with scope are doing
But for most of code it’s not needed
z
Zach Klippenstein (he/him) [MOD]
08/03/2020, 3:02 PM
Note that even if you pass an explicit job to the builder, the job inside the builder will be a different job that is a child of the one you pass in. And if you're manually creating a Job, don't forget to pass the current scope's job in as the parent.
l
Lukas Lechner
08/04/2020, 8:49 AM
@Zach Klippenstein (he/him) [MOD] Oh, thanks for the hint 🙂