Mikołaj Kąkol
03/19/2020, 7:14 AMscope
called bigScope
how can I create a scope smallScope
that will be canceled when bigScope
is cancelled?octylFractal
03/19/2020, 7:15 AMCoroutineScope(Job(bigScope.coroutineContext[Job]))
?Mikołaj Kąkol
03/19/2020, 7:18 AMval smallScope = CoroutineScope(Dispatchers.Main + bigScope.coroutineContext)
like that?val smallScope = CoroutineScope(Dispatchers.Main + Job(bigScope.coroutineContext[Job]))
compiles too, could you point a difference?octylFractal
03/19/2020, 7:19 AMJob(parent: Job)
constructor means structured concurrencysmallScope
is a child of bigScope
bigScope
Mikołaj Kąkol
03/19/2020, 7:20 AM