June 2018
Intermediate to advanced
310 pages
6h 32m
English
In addition to the threading model provided by Java, Kotlin also introduces a coroutines model. Coroutines might be considered lightweight threads, and we’ll see what advantages they provide over an existing model of threads shortly.
The first thing you need to know is that coroutines are not part of the language. They are simply another library provided by JetBrains. For that reason, if we want to use them, we need to specify so in our Gradle configuration file, build.gradle:
dependencies { ... compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.21" ...}
As of Kotlin 1.2, coroutines are still considered experimental. This doesn't mean that they don't work well, though, as some might think. It only means that some parts of ...
Read now
Unlock full access