Coroutines guide should highlight the dangers of runBlocking
#4412
Labels
guide
Issues with the coroutines guide on the website
runBlocking
#4412
Reported by @joffrey-bion in the Kotlinlang Slack.
Currently, the coroutines guide uses
runBlocking
freely to explain the concept of coroutines. However, in practice,runBlocking
does not have such a prominent role and is often error-prone: #4242At the top level, there is an alternative to
runBlocking
:It's not without its issues, though: it silently introduces multithreading (because no dispatcher is specified,
Dispatchers.Default
is used).I don't see a way around using the single-threaded
runBlocking
for some of the examples, but the issues withrunBlocking
should be highlighted.The text was updated successfully, but these errors were encountered: