<@U0GT43R61> <@U0F9NUBK9> E.g, if you code invokes...
# coroutines
e
@cbruegg @vonox7 E.g, if you code invokes
Thread.sleep(1000)
which blocks a thread for 1 second, then no amount of wrapping it into
async
will let you handle 100k of such operations simultaneously. However, with
delay(1000)
(non-blocking, but suspending) it is a nobrainer. You are welcome to perform an experiment from here yourself to verify it: https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#coroutines-are-light-weight I really recommend trying both the async version and the one where you replace
launch(CommonPool) {...}
with
thread {...}
and
delay
with
Thread.sleep
.