Still new to ktor client. My usual network stack for android apps was
1. okhttp
2. retrofit
3. moshi
4. eithernet
whats the usual for ktor? seems like ktor + kotlinx.serialization? Looks like ktorfit exists, but not really popular. is that because writing calls in ktor is easier? Anything like eithernet for ktor?
b
Blaž Vantur
04/13/2024, 10:28 AM
For the result of response we are directly using Kotlin Result class. From what I see EitherNet has some more features then Result class, but you could also build those with Result if there is a need for it. And other stack in our project is as you wrote, ktor + kotlinx serialization. We are also coming from Android world and we do miss simplicity of Retrofit, but in the end we decided to just use Ktor to have as less dependencies as possible for such core functionalities.
p
Pablichjenkov
04/13/2024, 5:50 PM
If you use eithernet result it doesn't force you to use it as your result library for your whole App? Or it maps to other railway oriented result/either libs, eg: arrow which is very popular.
On the retrofit side, ktor is pretty simple to use that may explain why ktorfit not so popular
c
Colton Idle
04/13/2024, 9:36 PM
eithernet result is convenient in my repository/useCases because of exhaustive when
p
Pablichjenkov
04/14/2024, 12:16 AM
Makes sense , in that regards any advantage over:
https://github.com/skydoves/sandwich
Or
https://github.com/haroldadmin/NetworkResponseAdapter
Or is basically the same, I actually got to know eithernet today 😁.
But for the name I thought was oriented to do railway oriented programming but I see is not the case, it is basically just dedicated to retrofit results.