Hexa
03/30/2019, 12:10 AMSatyam Agarwal
03/30/2019, 7:38 AMtseisel
03/30/2019, 10:19 AMThere are many approaches to this problem, and in Kotlin we take a very flexible one by providing Coroutine support at the language level and delegating most of the functionality to libraries, much in line with Kotlin's philosophy.This means that the core building blocks for using coroutines such as the
suspend
keyword (and some functions in the stdlib) are available without adding a dependency.
But they decided to move complex features (launch
, async
, and anything else) to libraries an particularly to kotlinx-coroutines
. That's why you'll need to add an explicit dependency to kotlinx-coroutines
most of the time.