Move PartitionProcessorRpcClient in restate_types, and rename it InvocationClient.#3211
Conversation
| } | ||
|
|
||
| /// This trait provides the functionalities to interact with Restate invocations. | ||
| pub trait InvocationClient { |
There was a problem hiding this comment.
This trait should really be ortoghonal from the transport, and in theory the types used here should not implement serde, nor any other serialization stuff. Coupling the types here couples the implementation too, and makes hard the future evolution (see the not so nice serde_hacks we ended up with in invocation and other modules...).
For now this is a simple refactoring of the existing code, but perhaps @muhamadazmy that's something you can keep in mind when working on network serialization.
In Java and other dynamic languages, this problem would be solved by overriding the default type serializer/deserializer class, allowing to evolve the "domain data structure" separately from its serialized representation. My understanding is that in rust the best we can do is proxy data structures, or using remote derive like https://serde.rs/remote-derive.html, but maybe there's some alternative out there for this...
tillrohrmann
left a comment
There was a problem hiding this comment.
Thanks for creating this PR @slinkydeveloper. The changes look good to me. +1 for merging.
d96abd5 to
235d6f8
Compare
…cationClient. The InvocationClient should be completely orthogonal from the transport, and should be easy to mock. We're gonna use this same client in the Admin API soon.
235d6f8 to
3e2cf2c
Compare
The
InvocationClientshould be completely orthogonal from the transport, and should be easy to mock.We're gonna use this same client in the Admin API soon for #3186 followups, for propagating errors in the admin api.