https://kotlinlang.org logo
#ktor
Title
# ktor
k

Kris Wong

01/14/2020, 11:17 PM
i seem to be experiencing a deadlock in
<http://HttpClient.post|HttpClient.post>
on iOS. the method never returns. it's called from within a
runBlocking
block from the main thread (from a unit test). has anyone experienced this?
I have verified the server is responding. it's also running on my machine.
unfortunately I can't debug because iOS unit tests are run on the iOS simulator via command line.
c

cy

01/15/2020, 6:43 AM
// cc @e5l
e

e5l

01/15/2020, 6:45 AM
Hi @Kris Wong,
runBlocking
doesn’t work with iOS right now(but we’re working on it)
Here is the details about using iOS client: https://github.com/ktorio/ktor/issues/678
k

Kris Wong

01/15/2020, 1:57 PM
wow. I believe you guys really need to call this out somewhere in the docs. otherwise it's not possible to use Ktor in an MPP library with an iOS target.
👍 1
I can't seem to find a workaround. the suggestion on the issue report ends up causing "There is no event loop. Use runBlocking { ... } to start one."
ironic