Hey, for a new project we are thinking to completely avoid coroutines and stick with rx with Reaktive.
Now I'm just starting to play with KMM for the first time and I'm trying to make a simple network request.
All the examples I'm seeing (Ktor, Fuel) are using suspend functions. Should I just use
coroutines-interop
or is there a way to get synchronous calls out of the popular libraries for kmm networking?
a
Arkadii Ivanov
05/11/2023, 6:31 PM
Great to hear that! Unfortunately, Ktor is the only multiplatform http client I'm aware of, and it's all based on coroutines. So either use coroutines-interop, or try wrapping calls into singleFromFunction + runBlocking (I didn't try this option).
s
StavFX
05/11/2023, 6:32 PM
yeah singleFromCoroutine sounds like it gets the job done easily enough
a
Arkadii Ivanov
05/11/2023, 6:35 PM
I would just hide Ktor behind a Reaktive-based interface