-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add abstract Communication Layer API traits #124
Add abstract Communication Layer API traits #124
Conversation
Added traits for publishing messages, sending notifications and invoking remote service operations. These traits represent the uProtocol Communication Layer API that uEntities can use to interact with each other using uProtocol.
5469eef
to
609eee1
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.
One suggestion, one question...
/// [Communication Layer API Specifications](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc). | ||
#[async_trait] | ||
pub trait RpcServer: Send + Sync { | ||
async fn register_endpoint( |
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.
Just in keeping with the other method declarations so far: do we want some docstrings here?
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.
Yes, definitely. Another thing I stumbled upon: for listeners to Publish messages it makes sense to be able to register multiple listeners for the same source address. However, I wonder if we should restrict the number of request listeners per (local) resource ID to one only. Otherwise you might end up in a situation where a client gets back multiple responses to its request. WDYT? @AnotherDaniel @evshary
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.
Yes, agree - also this would give implementors on server-side a little less rope to hang themselves with...
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.
Second it. I remember we had a conclusion that Notification and RPC should be 1-to-1, and Publish is 1-to-N in the weekly meeting. I think it will be more simplified.
method: &UUri, | ||
listener: Arc<dyn RpcClient>, | ||
) -> Result<(), RegistrationError>; | ||
async fn unregister_endpoint( |
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.
Same comment as for register_endpoint()
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.
LGTM
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.
Add some questions
LGTM basically.
Added traits for publishing messages, sending notifications and
invoking remote service operations. These traits represent the
uProtocol Communication Layer API that uEntities can use to
interact with each other using uProtocol.
This is the first step for #122