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

Support Notification-style Publish. #9

Merged

Conversation

evshary
Copy link
Contributor

@evshary evshary commented Mar 5, 2024

As @PLeVasseur mentioned in #6, support Notification-style Publish.

evshary added 2 commits March 5, 2024 16:02
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@PLeVasseur
Copy link
Contributor

Hey @sophokles73 -- can I have you take a look at this to make sure I asked @evshary to do the right thing?

We're trying to handle Notification-style Publish message types by using the sink instead of source UUri when crafting the Zenoh key expression to send on.

name: "body.access".to_string(),
version_major: Some(1),
id: Some(1234),
fn create_utransport_uuri(index: u8) -> UUri {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the idea that you'd in the future keep adding more UUris in here for testing purposes and you want to have a single factory function for creating them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. That's my intention.
Feel free to give me your opinions about this. I'm still wondering whether there is a more elegant way to do so.

@@ -482,7 +482,13 @@ impl UTransport for UPClientZenoh {
)
})?;
// Get Zenoh key
let topic = attributes.clone().source;
let topic = if attributes.sink.is_some() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, seems like this is what we need 🙂

Just wanna get some input from @sophokles73

Copy link
Contributor

Choose a reason for hiding this comment

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

It is correct to assume that you are dealing with a Notification if sink is not empty and a Publish otherwise.

Copy link
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

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

Aside from the nit comment on the unit tests, I'll go ahead and approve 🙂

@sophokles73 sophokles73 merged commit 17599bb into eclipse-uprotocol:main Mar 6, 2024
4 checks passed
@evshary evshary deleted the support_notification branch March 6, 2024 13:12
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