https://kotlinlang.org logo
#coroutines
Title
# coroutines
r

rattleshirt

12/20/2019, 9:53 AM
In the new native-mt model what would be the equivalent of Dispatchers.IO for iOS in a AppCoroutineDispatchers class with main = Main, computation = Default and io? Would that be
newSingleThreadContext("io")
?
Similar to what you would use in a viewModel (in android) to launch a coroutine:
viewModelScope.launch(<http://dispatchers.io|dispatchers.io>) {}
but now in common code
g

gildor

12/20/2019, 11:38 AM
There is no IO for iOS yet. Yes, single thread dispatcher is only simple solution for now, but it's not really IO, it has only one thread so works differently than real IO from JVM
r

rattleshirt

12/20/2019, 12:05 PM
Thanks for the explanation. Are there any plans to include it?
d

Dominaezzz

12/20/2019, 12:24 PM
Eventually
3 Views