https://kotlinlang.org logo
#ktor
Title
# ktor
o

Omar Habash

02/21/2022, 12:35 PM
Hello everyone, is it possible to use ktor client for gRPC/protobuf and KMM (iOS/Android)? If someone could point me to a sample project/guide/docs that'd be great!
a

Aleksei Tirman [JB]

02/21/2022, 12:42 PM
There is a feature request to have it in Ktor.
o

Omar Habash

02/21/2022, 12:42 PM
Thank you so much! So other than this, no luck huh?
a

Aleksei Tirman [JB]

02/21/2022, 12:43 PM
Unfortunately, yes.
o

Omar Habash

02/21/2022, 12:44 PM
What do you think about this? Last updated 2020 Feb 😕 https://github.com/marcoferrer/kroto-plus
a

Aleksei Tirman [JB]

02/21/2022, 12:47 PM
Seems like it doesn't support multiplatform.
o

Omar Habash

02/21/2022, 12:49 PM
Rightly so, it only supports Kotlin/JVM as mentioned here
One final question to finalize this thread, do you think it makes sense to implement gRPC from native side (Android/iOS) and have a common interface around it defined in the shared module? • Sort of like this for WebSockets from Kotlinlang docs, but for gRPC instead of WebSockets. •
kotlinx.coroutines
and the new memory model need to be used here most likely, correct?
a

Aleksei Tirman [JB]

02/22/2022, 11:26 AM
If you can write a solid interface which's abstraction won't leak much then it makes sense. You can use the new memory model for iOS but keep in mind that it's still experimental.
👍 1
🙏 1
d

David Nedrow

02/23/2022, 9:09 PM
177 Views