-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify RpcStyle message routing #1511
Conversation
c73b8ea
to
9e861c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @AhmedSoliman. The RpcRouter
looks like a cool abstraction. The changes look good to me :-) +1 for merging.
&self, | ||
msg: restate_node_protocol::MessageEnvelope<Self::MessageType>, | ||
) -> impl std::future::Future<Output = ()> + Send { | ||
self.handle_message(msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log on debug or trace if a message could not be handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about that one. I suspect that it can be a common place where the tracker token is dropped on timeouts and it would be noisy (and potentially not very useful) log message in this case.
Introduces types that makes it easier to perform Rpc-like interactions with Networking. - `RpcMessage` trait marks messages that carry a `CorrelationId`. A sane default correlation id is provided as `RequestId`. - `RpcRequest` trait defines request messages and their response types. - `RpcRouter<T: RpcRequest>` enables sending rpc request and awaiting responses with auto eviction of dropped requests. - `ResponseTracker` is a helper that manages tracking tokens for in-flight requests, this can be used in the future to replace large portions of IngressDispatcher. - Macros to help define RPC messages to reduce code noise in node-protocol
Unify RpcStyle message routing
Introduces types that makes it easier to perform Rpc-like interactions with Networking.
RpcMessage
trait marks messages that carry aCorrelationId
. A sane default correlation id is provided asRequestId
.RpcRequest
trait defines request messages and their response types.RpcRouter<T: RpcRequest>
enables sending rpc request and awaiting responses with auto eviction of dropped requests.ResponseTracker
is a helper that manages tracking tokens for in-flight requests, this can be used in the future to replace large portions of IngressDispatcher.Stack created with Sapling. Best reviewed with ReviewStack.