Hi! I wrote a small RPC library that provides the...
# feed
t
Hi! I wrote a small RPC library that provides the most convenient way (I think) for client-server communication. It’s experimental right now. I plan to use it in my own projects it will eventually mature. Feedback, ideas, criticism would be very welcome. I would like to see if there is any interest from the community to decide how much work I put into the polishing, documentation and ease-of-use (such as a FIR plugin for IDE feedback). Github repo: Z2 Service
👍 6
neat 2
👍🏾 1
K 1
r
@Tóth István Zoltán You should look into the remoting module of kvision, which does something similar. A few things from kvision remoting that I prefer over z2-service, after a brief perusal of the README: • kvision remoting uses kotlinx serialization • kvision uses the standard JSON-RPC for the wire protocol (but I'm guessing isn't strictly tied to json because of the use of kotlinx-serialization) • protobuf is great for perf, but not so great for easy debugging e.g. in chrome network inspector -- provide other options (use kotlinx serialization to mostly abstract the encoding away) • kvision remoting has support for exception serialization (yours may too, but I don't see any mention of it in the docs) • kvision remoting supports channels and websockets Related docs: https://kvision.gitbook.io/kvision-guide/6.-full-stack-development-guide/overview
t
Oh, that's a good one! I've searched for RPC libraries but haven't found this. Thank you for letting me know.
Also, your cons are valid. I intentionally wanted to avoid kotlinx.serialization, mostly because this module is used by another which sends partial objects and that's hard with kotlinx.serializaton.
About exceptions: I send only a status code and that is also intentional. Exceptions may contains security sensitive data, so it's better not to send them out as they are. Technically there is place for the error data but I haven't added the possibility to fill it yet. Probably it will be a specific exception you have to use with supplying the data.
r
Thanks for the additional context @Tóth István Zoltán. Always great to see more options!