bootstraponline
12/08/2019, 9:44 PMkotlinx.coroutines.runBlocking
on iOS?
https://github.com/bootstraponline/run_blocking/blob/master/src/commonMain/kotlin/example/Common.kt
https://github.com/bootstraponline/run_blocking/blob/master/src/iosMain/kotlin/example/RunBlocking.kt
I have a simple example that compiles to an iOS framework. iOS hangs on kotlinx.coroutines.runBlocking
and never returns. On the JVM, runBlocking works as expected.russhwolf
12/08/2019, 10:12 PMbootstraponline
12/08/2019, 10:14 PMbootstraponline
12/08/2019, 10:15 PMbootstraponline
12/08/2019, 10:15 PMhealthCheck
method is defined in Common.kt
linked above.russhwolf
12/08/2019, 10:21 PMmainDispatcher
which is Dispatchers.Main
on Android and a custom dispatcher on iOS. That custom dispatcher then can look something like this https://github.com/russhwolf/multiplatform-hello/blob/master/shared-client/src/iosMain/kotlin/mainDispatcher.ktrusshwolf
12/08/2019, 10:23 PMiosTest
gradle task that runs tests on the simulator without needing to involve xcode. And you can pass a mock engine to ktor so you don’t need to make an actual web call in your tests.bootstraponline
12/08/2019, 10:24 PMrusshwolf
12/08/2019, 10:25 PMbasher
12/09/2019, 1:57 AMrunBlocking(block: suspend CoroutineScope.() -> T): T
basher
12/09/2019, 1:58 AMrusshwolf
12/09/2019, 2:02 AMbasher
12/09/2019, 2:11 AMbasher
12/09/2019, 2:13 AM