In the latest Ktor version 1.4.1 I was able to fre...
# ktor
t
In the latest Ktor version 1.4.1 I was able to freeze the Ktor client and still make network requests. That is really great, thanks a lot for making this possible. I was wondering if using the
Ios
engine from
Dispatchers.Default
is supported, too? I tried that and get an
IncorrectDereferenceException
from Ktor code. When I modify the Ktor
io.ktor.client.engine.ios.IosClientEngine
code (and related files in the same package) by adding some
freeze()
calls, it works fine when called from
Dispatchers.Default
. Is this expected behaviour at this time?
e
Hey, thanks. We really going to improve iOS experience in future and adding
Dispatchers.Default
support is the next step
t
Hey, that is great news!
I added only two
freeze()
calls to the Ios engine code and it works with
Dispatchers.Default
in my project already.
Add_freezing_support_to_Ios_engine.patch
e
That will prevent fall, but will not force to work in the dispatcher thread. That's also nice to fix, could you make a PR?
t
@e5l What exactly would you like me to create a PR for? Only adding the freeze calls like above or also fixing the dispatcher thread? I am not sure how to force it to work in the dispatcher thread.
e
I'm about the first part of fix. I'm going to research the second part
t
I also noticed that instead of using freeze directly you use makeShared in Ktor. Which one of those would you like me to use in the PR?
e
makeShared
is for common code, in native you can use
freeze
or
makeShared
t
The base branch is master, hope that is alright.
e
Thanks, will take a look