Join Slack
Powered by
Why isn't ktor-client using <Dispatchers.IO>?
# ktor
n
nordiauwu
01/04/2022, 2:59 PM
Why isn't ktor-client using
Dispatchers.IO
?
r
Ryan
01/04/2022, 3:05 PM
getting blown up for call.receive?
n
nordiauwu
01/04/2022, 3:08 PM
They could use limited parallelism
r
Ryan
01/04/2022, 3:08 PM
i don't know what that means yet
n
nordiauwu
01/04/2022, 3:09 PM
see
https://github.com/Kotlin/kotlinx.coroutines/issues/2919
r
Ryan
01/04/2022, 3:12 PM
is there a way to set it to use withContext(
Dispatchers.IO
) all the time?
Ryan
01/04/2022, 3:12 PM
put("/") { call.receive() }
Ryan
01/04/2022, 3:12 PM
now i need to do put("/") { withContext(
Dispatchers.IO
) {}}
n
nordiauwu
01/04/2022, 3:17 PM
I'm not sure about the server but ktor-client uses something called
ClosableBlockingDispatcher
and I'm wondering why
h
hfhbd
01/04/2022, 4:52 PM
It will soon:
https://github.com/ktorio/ktor/blob/0da078614841f50323057fd789606be9da9adfc5/ktor-client/ktor-client-core/jvm/src/io/ktor/client/utils/CoroutineDispatcherUtils.kt#L22
👍 1
476
Views
Open in Slack
Previous
Next