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

feat!: add background method to builders with callback #1522

Merged
merged 8 commits into from
Oct 9, 2024

Conversation

wyfo
Copy link
Contributor

@wyfo wyfo commented Oct 8, 2024

No description provided.

@wyfo wyfo added breaking-change Indicates that the issue implies a breaking change (be it at compile time or at runtime) api fix Correct API labels Oct 8, 2024
Copy link
Contributor

@milyin milyin left a comment

Choose a reason for hiding this comment

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

Looks good except some doc comments. Also as far as I understand this fix doesn't solve the problem with cancelling backgrounded entity yet?

/// } else {
/// println!("Publisher has NO MORE matching subscribers.");
/// }
/// })
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no background() call in the example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oups, indeed, it's fixed

pub fn undeclare_on_drop(mut self, undeclare_on_drop: bool) -> Self {
self.undeclare_on_drop = undeclare_on_drop;
self
/// Background builder doesn't return a `MatchingListener` object anymore.
Copy link
Contributor

Choose a reason for hiding this comment

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

better to reformulate this, this is piece of documentation, not a comment to PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you want to reformulate?

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like this:
"Suppress returning MatchingListener object from builder. The listener callback stays alive for the lifetime of the session ". Doesn't matter too much though

impl<'a, 'b> QueryableBuilder<'a, 'b, Callback<Query>> {
/// Register the queryable callback to be run in background until the session is closed.
///
/// Background builder doesn't return a `Queryable` object anymore.
Copy link
Contributor

Choose a reason for hiding this comment

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

same. User doesn't care that we have different variant of builders, background, not background. Better to describe how this option affects behavior

@milyin milyin merged commit d3768b8 into eclipse-zenoh:main Oct 9, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api fix Correct API breaking-change Indicates that the issue implies a breaking change (be it at compile time or at runtime)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants