https://kotlinlang.org logo
#coroutines
Title
# coroutines
b

Bee

02/27/2021, 3:21 PM
I am having difficulty getting the difference in behavior between
runBlocking
and
coroutineScope
, which I put into this question. Could someone help me with it, please?
z

Zach Klippenstein (he/him) [MOD]

02/27/2021, 5:16 PM
The biggest difference is that
runBlocking
is for running coroutine code from a non-suspend functions. It’s not a suspend function itself.
coroutineScope
is a suspend function and can only be called from other suspend functions.
6 Views