https://kotlinlang.org logo
#ios
Title
# ios
d

darkmoon_uk

06/14/2019, 10:48 AM
To establish the Event Loop required to use Ktor in iOS, should I put the whole content of the
main
function inside
runBlocking
? I'm aware that only the main thread can be used for coroutines at present, and have created a main thread Dispatcher, but launching with this dispatcher - according to the error I'm receiving - does not set up an Event Loop.
e

e5l

06/14/2019, 11:12 AM
Hi @darkmoon_uk,
runBlocking
doesn't cooperate with NSQueue for now(details: https://github.com/Kotlin/kotlinx.coroutines/issues/770). To execute request you can use
launch
or
async
in
Dispatchers.Unconfined
.
10 Views