https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

Kris Wong

12/20/2019, 5:07 PM
has anyone used channels? this example shows constructing a
Channel
https://github.com/kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt, but
Channel
is an interface
d

Dominaezzz

12/20/2019, 5:10 PM
Channel
is also a function to make channels
k

Kris Wong

12/20/2019, 5:10 PM
just saw that 🙂
for some reason it doesn't seem to be working from my common code, though
d

Dominaezzz

12/20/2019, 5:13 PM
Not working?
k

Kris Wong

12/20/2019, 5:14 PM
yes, that source set can't see anything in kotlinx.coroutines.channels
d

Dominaezzz

12/20/2019, 5:14 PM
Enable metadata?
k

Kris Wong

12/20/2019, 5:15 PM
i feel like there is an iOS specific dependency that I am missing
d

Dominaezzz

12/20/2019, 5:15 PM
Does
kotlin.coroutines
resolve at all?
k

Kris Wong

12/20/2019, 5:15 PM
and JVM
d

Dominaezzz

12/20/2019, 5:16 PM
I think you need to explicitly add coroutines dependency to each source set.
k

Kris Wong

12/20/2019, 5:17 PM
oh, the package is
kotlinx-coroutines-core-common
☝🏼 1
i was using
Copy code
kotlinx-coroutines-core
now we're cooking
common gets core-common, JVM gets core, and native gets core-native
k

Kris Wong

12/20/2019, 6:59 PM
got my channel, now I am missing
runBlocking
😱
k

kpgalligan

12/20/2019, 7:00 PM
Doesn’t exist in common. You can expect/actual to jvm and native
k

Kris Wong

12/20/2019, 7:05 PM
oh, so it's in native, but not in common?
interesting... i guess maybe because it's not in JS or something?
k

kpgalligan

12/20/2019, 7:06 PM
Yeah. My understanding is the JS situation
k

Kris Wong

12/20/2019, 7:06 PM
gotcha