Skip to content
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

Merged

Conversation

sophokles73
Copy link
Contributor

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

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.
Copy link
Contributor

@AnotherDaniel AnotherDaniel left a 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(
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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...

Copy link
Contributor

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(
Copy link
Contributor

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()

src/utransport.rs Show resolved Hide resolved
Copy link
Contributor

@AnotherDaniel AnotherDaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@evshary evshary left a 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.

src/utransport.rs Show resolved Hide resolved
src/utransport.rs Outdated Show resolved Hide resolved
src/utransport.rs Show resolved Hide resolved
@sophokles73 sophokles73 merged commit d8ed07e into eclipse-uprotocol:main Jun 19, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants