does `withContext()` get it’s own coroutineScope o...
# coroutines
j
does
withContext()
get it’s own coroutineScope or inherit it from whoever is calling the function?
m
It gets its own
CoroutineContext
.
s
Yes; it's in the same scope. Cancelling out of a withContext() block will cancel the calling coroutineScope (depending on the type of Job its context has) and cancelling the calling coroutineScope will cancel any suspended code within the withContext() block.