About 1.3 coroutines

In Kotlin 1.3,the “kotlinx.coroutines.experimental.async” prompts deprecated.What substitutes it?


Sorry.I use " import kotlinx.coroutines.async" to replace " import kotlinx.coroutines.experimental.async",but Android Studio prompts error.How should I do?

You need to provide a coroutine-scope. Either you class needs to implement the interface CoroutineScope, or you need to have one from another call and use myCoroutineScope.async { ... }.

I believe this is different from the experimental coroutines.

Is the “CoroutineScope” in Anko Coroutines?

No, it is in the new coroutine libraries.

    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
// for android you may also need this, there are also similar libraries for JavaFX and Swing.
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1"