runBlocking exists in all targets except JS.
I have a lib that you can use it in common code if you are not using JS. For testing I have another artifact based on what I could see in the turbine repository by cashapp/square
https://github.com/JavierSegoviaCordoba/run-blocking-kmp
t
tylerwilson
07/13/2021, 9:21 PM
I incorporated an expect/actual of a runBlocking wrapper, ran it and the same result. I suspect it is related to some other setup needed for Ktor on macOS. Will keep trying things. Thank you both for the links.
l
louiscad
07/14/2021, 7:00 AM
You can use Dispatchers.Main with the native-mt version of kotlinx.coroutines
louiscad
07/14/2021, 7:00 AM
MainScope() would work as well.
t
tylerwilson
07/14/2021, 1:10 PM
I changed to using ktor-client-ios for macOS, and also turned on this switch. All working now.