I watched the amazing talk from KotlinConf 2018 an...
# coroutines
c
I watched the amazing talk from KotlinConf 2018 and I'm trying to use the same example with an extension function on CoroutineScope, however I can't seem to be able to import it in Kotlin/Multiplatform, is it not implemented? IntelliJ suggests CoroutineContext, but I don't know if those are equivalent or not
g
Have you add kotlinx.coroutines to your MPP project?
CoroutineScope is part of kotlinx.coroutines library, not a part of Kotlin stdlib
c
Looks like that was the problem. The official readme only gives artifacts for native, JS, and Android. Is there one for regular JVM? From the text it seems to me that the Android is specific and cannot be used for standard JVM
g
You just need core artifict (available for all platforms) https://github.com/Kotlin/kotlinx.coroutines/blob/master/README.md#gradle
Android, is just Android specific artifact that provides integration with Android Main thread
See the description of all kotlinx.coroutines libraries: https://github.com/Kotlin/kotlinx.coroutines/blob/master/README.md#modules
c
Oh, I thought Multiplatform needed the core + implementation in each platform
g
Yeah, jvm version is called just kotlinx-coroutines-core 🤷‍♂️ Also it's possible now with Gradle metadata publish library that has info about artifacts for different platforms, this is what Kotlin MPP does
c
Oooh so this is what metadata does!
Also, thanks you were right it fixed my problems