kotlinx-rpc
kotlinx-rpc copied to clipboard
Separation of kotlinx.rpc runtime and kRPC protocol implementation
AFAIK from the sources, on current moment kotlinx-rpc runtime consists of:
- kotlinx.rpc basic types (like RPC, RPCClient, RPCServer, RPCCall, RPCField) used by compiler plugin to generate support code and can be used to implement transport for
rpc - kRPC protocol implementation with client and server modules specifically for them with
RPCTransportandRPCConfigused mostly for them and not really required for implementation via other protocols (RSocket, gRPC).runtime-serializationandruntime-loggingare also mostly needed for kRPC. transport-ktorwhich binds kRPC to ktor for both client and server
Are there any plans on somehow better borders between kotlinx.rpc API and kRPC implementation?
On current moment it's a little confusing to understand, which types to use to implement custom protocols.
If I may, this is how I see the high-level structure here per modules:
kotlinx-rpc-core- just core APIs used both by kRPC and other protocols (it's mostly currentruntimemodule, but withoutRPCTransportandRPCConfigandinternalclasses, which implements kRPC)kotlinx-rpc-krpc(orkotlinx-rpc-krpc-shared/kotlinx-rpc-krpc-internal/etc.),
kotlinx-rpc-krpc-client,
kotlinx-rpc-krpc-server- (yeah, naming is hard, but still) kRPC implementation withRPCTransportandRPCConfig(probably renamed toKRPC*),internalclasses from runtime module and APIs for client and server to bind kRPC implementation to some transport (f.ektor).serializationandloggingmodules most likely should go in this category.transport-ktormodules probably just renamed to mention that they arekrpcspecific.- in future then the project could have
kotlinx-rpc-grpc- which AFAIU should not depend onkRPCat all - but may be I'm missing something here :)
Would be nice to hear what you think, as may be I don't know about some future plans/ideas.
P.S. I'm very glad to see kotlinx-rpc and I'm willing to try to implement rsocket-kotlin integration!
Hey @whyoleg ! You are totally right, the namings are misleading right now and are the legacy from the previous internal structure.
Basically, you got all of the details right, and gRPC won't be dependent of kRPC
The issue, as you mentioned, is that kotlinx-rpc-krpc- prefix is meh to put it shortly.
We will come up with a better structure and put it into 0.2.0 release
As per rsocket integration - this is what we would be very interested in. And firstly in terms of how easy it is to work this existing APIs, what should be added/improved. Please, feel free to contact me anytime for any questions and suggestions
Thanks for the fast feedback!
The issue, as you mentioned, is that kotlinx-rpc-krpc- prefix is meh to put it shortly.
Yeah, several other options to consider, while we are here (order is irrelevant):
- use just
kotlinx-krpc-*withoutrpcin the middle (which is stillkotlinx-kotlin-rpcbut a little bit nicer) - extract
krpcto a separate project (similar to ktor/exposed), package could bekrpc/io.krpc/org.jetbrains.krpcand leavekotlinx-rpcas compiler plugin + small runtime. Overall, while kPRC is KMP specific, it's still looks for me like a separate project/product - come up with another name (but I really like kRPC)
We will come up with a better structure and put it into 0.2.0 release
Looking forward to it!
As per rsocket integration - this is what we would be very interested in. And firstly in terms of how easy it is to work this existing APIs, what should be added/improved.
Yeah, I'm planning to create a PoC in coming weeks...
Hi! Some updates regarding this issue
These current modules:
kotlinx-rpc-runtime
kotlinx-rpc-runtime-api
kotlinx-rpc-runtime-client
kotlinx-rpc-runtime-server
kotlinx-rpc-runtime-logging
kotlinx-rpc-runtime-test
kotlinx-rpc-runtime-serialization
kotlinx-rpc-runtime-serialization-cbor
kotlinx-rpc-runtime-serialization-protobuf
kotlinx-rpc-transport-ktor
kotlinx-rpc-transport-ktor-client
kotlinx-rpc-transport-ktor-server
Will be renamed to these (order preserved):
kotlinx-rpc-core
kotlinx-rpc-core-api
kotlinx-rpc-krpc-client
kotlinx-rpc-krpc-server
kotlinx-rpc-krpc-logging
kotlinx-rpc-krpc-test
kotlinx-rpc-krpc-serialization
kotlinx-rpc-krpc-serialization-cbor
kotlinx-rpc-krpc-serialization-protobuf
kotlinx-rpc-krpc-ktor-core
kotlinx-rpc-krpc-ktor-client
kotlinx-rpc-krpc-ktor-server
Other modules will stay as is for now If you have any issues with it - please express them here