-
Notifications
You must be signed in to change notification settings - Fork 256
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
Non-blocking receive never notifies #820
Comments
hey, thanks for reporting. in case 3, you can increase the timeout duration, e.g. for case 2, i will get back to you! |
Requests take a while to be processed, so both We require a sync specific |
From a users perspective the timeout in If For now I moved the let (mut client, mut connection) = Client::new(mqttoptions, 100);
let (send_event, recv_event)= std::sync::mpsc::channel();
std::thread::spawn(move || {
for notification in connection.iter() {
send_event.send(notification).unwrap();
}
});
...
loop {
if let Ok(notification) = recv_event.try_recv() {
println!("Notification = {:?}", notification);
}
} Maybe it is possible to do something similar in the |
Expected Behavior
Expected case 1, 2 and 3 to print the same notifications.
Current Behavior
Only case 1 prints notifications, case 2 and 3 show no notifications.
Context
Trying to integrate non-blocking receive into an existing event loop. But
try_recv()
andrecv_timeout()
never generate meaning full notifications.recv()
does generate notifications, but is blocking.The text was updated successfully, but these errors were encountered: