the code is non blocking anymore but I can't see any messages printed to the console 🤔
j
Joffrey
01/14/2022, 5:52 PM
Which version of coroutines are you using? The standalone
launch
in your
greet()
function should not compile without coroutine scope 🤔
r
Ryan Zidago
01/14/2022, 6:03 PM
My bad I forgot to add the
coroutine
scope.
I just edited my post.
j
Joffrey
01/14/2022, 6:13 PM
That edited code works fine, and prints stuff. They are both equivalent because
runBlocking
waits for child coroutines to finish before returning. You can see it run here: https://pl.kotl.in/DHI3W7ifV
If you're not seeing this result, you should probably share the actual code you're using