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 warning if drop-callback is passed with a tuple #366

Merged

Conversation

wyfo
Copy link
Contributor

@wyfo wyfo commented Oct 18, 2024

Fixes #364

Copy link
Contributor

PR missing one of the required labels: {'dependencies', 'breaking-change', 'internal', 'bug', 'enhancement', 'documentation', 'new feature'}

@wyfo wyfo requested review from milyin and Mallets October 18, 2024 14:25
@Mallets Mallets added the internal Changes not included in the changelog label Oct 18, 2024
@Mallets Mallets enabled auto-merge (squash) October 18, 2024 14:29
@Mallets Mallets merged commit 50ef20b into eclipse-zenoh:main Oct 18, 2024
10 of 11 checks passed
@@ -29,6 +29,13 @@ use crate::{
type RustCallback<T> = zenoh::handlers::Callback<T>;

const CHECK_SIGNALS_INTERVAL: Duration = Duration::from_millis(100);
const DONE_CALLBACK_WARNING: &str = "Passing drop-callback using a tuple \
`(callback, drop-callback)` no more works in 1.0;\n\
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`(callback, drop-callback)` no more works in 1.0;\n\
`(callback, drop-callback)` no longer works in 1.0;\n\

const DONE_CALLBACK_WARNING: &str = "Passing drop-callback using a tuple \
`(callback, drop-callback)` no more works in 1.0;\n\
`zenoh.handlers.Callback(callback, drop_callback)` must be used instead.\n\
The tuple form is reserved for passing a handler with`(callback, handler)`.\n\
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The tuple form is reserved for passing a handler with`(callback, handler)`.\n\
The tuple form is reserved for passing a handler with `(callback, handler)`.\n\

`zenoh.handlers.Callback(callback, drop_callback)` must be used instead.\n\
The tuple form is reserved for passing a handler with`(callback, handler)`.\n\
If you are already passing a handler but having this warning wrongly displayed, \
you can silent it with:\n\
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
you can silent it with:\n\
you can silence it with:\n\

`(callback, drop-callback)` no more works in 1.0;\n\
`zenoh.handlers.Callback(callback, drop_callback)` must be used instead.\n\
The tuple form is reserved for passing a handler with`(callback, handler)`.\n\
If you are already passing a handler but having this warning wrongly displayed, \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you are already passing a handler but having this warning wrongly displayed, \
If you are already passing a handler and this warning is still incorrectly displayed, \

@wyfo wyfo added enhancement Things could work better breaking-change API breaking change and removed internal Changes not included in the changelog labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change API breaking change enhancement Things could work better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug/Breaking Change] session.get tuple callback no longer works in 1.0.0
3 participants