while trying to explain the difference `runBlockin...
# coroutines
m
while trying to explain the difference
runBlocking
and
coroutineScope
in the coroutine docs, it says
coroutineScope
does not block the current thread while waiting for all its children to complete. Then an example was given that shows otherwise.
coroutineScope
actually blocks the thread that
runBlocking
was invoked from while waiting for its children to complete. Have I understood this the wrong way?
e
coroutineScope
does not block a real thread, it suspends coroutine same as
delay
does
j
But
runBlocking
does block. So your thread was blocked by
runBlocking
, not by
coroutineScope