https://kotlinlang.org logo
#reaktive
Title
# reaktive
m

Mina Eweida

04/13/2020, 6:41 PM
Hi, I was reading about not using Ktor coroutines-interop
Ktor does not work well in multithreaded environment in Kotlin/Native (it may crash), so please don’t mix Ktor and 
coroutines-interop
My question is, does it crash with a specific type of request i.e. get, post? Because my use case is simply fire and forget a post request, I am not expecting any response. So does it crash because of multithreading and sharing results or crashes were reported on firing requests in general?
a

Arkadii Ivanov

04/13/2020, 6:57 PM
Hi. Ktor is very likely to crash when used from a background thread. Does not matter if you are waiting for a result or not. You can read more in this issue. If you really need to use the Ktor then you can try
singleFromCoroutineUnsafe
sample from README. But make sure everything is on main thread.
👍 1
4 Views