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