To establish the Event Loop required to use Ktor i...
# ios
d
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
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
.