How can I create a sub-scope of a CoroutineScope? ...
# announcements
d
How can I create a sub-scope of a CoroutineScope? I'm looking for something like
Copy code
val parentScope: CoroutineScope
val childScope = parentScope.something()
I want childScope to be cancelled if parentScope is, but for parentScope not to be cancelled if childScope is
m
CoroutineScope(parentScope.coroutineContext + SupervisorJob())
or
Copy code
supervisorScope { your child code() }
d
Thank you