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

Cyrille QUÉMIN

07/11/2019, 11:12 AM
Hey guys, kotlin co routine multiplatform mentioned that it is single thread (js style) on native platform. Is it exactly like JS with a delegation principal to a background thread? Or does everything solely run on the main thread ??? If so. Is there a way to "hook" it up to iOS dispatch system in order to have at least one more thread to be able to do computation in the background and updating progress on the main thread for example?
g

gildor

07/11/2019, 12:05 PM
It's possible to run coroutines on another thread on iOS, but you cannot transfer data between threads, for moving work to another thread you have to use workers API for now
You also can check this discussion on coroutines issue tracker https://github.com/Kotlin/kotlinx.coroutines/issues/462
c

Cyrille QUÉMIN

07/11/2019, 2:42 PM
thank you guys. I’ll have a look at all your links
a

Arkadii Ivanov

07/11/2019, 10:44 PM
For multithreading in common source set you can also use https://github.com/badoo/Reaktive
2 Views