Coroutine implementation
Now let’s see how to implement coroutines in a Kotlin project. For this, we’ll start from scratch. First, we’ll do something very simple; we can consider it the “Hello World" of coroutines. Then we’ll increase the difficulty of the example and show other features.
We will start by adding the possibility of using coroutines in our project, and for that, we will add the dependency.
One thing to note is that using kotlinx.coroutines has become a convention in the Kotlin community, making it easier to collaborate and understand code.
We don’t recommend trying to memorize the versions, since over time, these change, and they change faster than you can imagine. It is more important to know what the official kotlinx.coroutines repository is. GitHub is a reliable source to obtain information about the latest versions and news: https://github.com/Kotlin/kotlinx.coroutines.
In general terms, we can say that...