https://kotlinlang.org logo
#android
Title
# android
t

The Monster

09/06/2021, 1:31 AM
Hey the doc says
runBlocking
blocks the current thread, so why is
Hello
still printed first? Shouldn't it blocks for 3 secs and prints
Hello
at the end?
s

Stuie

09/06/2021, 1:45 AM
// launch a new coroutine and continue
j

Jacob

09/06/2021, 1:50 AM
runBlocking blocks the current thread from continuing past the runBlocking block.
1
🙌 1
Within the block it uses some sort of event loop
t

The Monster

09/06/2021, 1:53 AM
oh wait i'm dumb. The
println("Hello")
is still inside of the
runBlocking
. I thought it was outsside.
😂 2