Move Operations to Coroutines | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5443783-kotlin-coroutines-in-depth/lessons/2

Could you please tell me why you use while and don’t use runBlocking ?

Hey @yvgen!

I’ve used a while loop instead of runBlocking to imitate computing and as such hold the program. I wanted to avoid runBlocking where possible, because it’s often misused.

In most real-life examples you won’t be using runBlocking, but you might have a blocking call.

Does this make sense? :]

Got it, thank you for the answer.

1 Like