You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A local liveliness token undeclaration will trigger the other token undeclaration in a chain reaction.
To reproduce
use zenoh::{prelude::*,Config};use zenoh::sample::SampleKind;#[tokio::main]asyncfnmain(){// Initiate logging
zenoh::try_init_log_from_env();println!("Opening session...");let session = zenoh::open(Config::default()).await.unwrap();let subscriber = session
.liveliness()// .declare_subscriber("@ros2_lv/0/**").declare_subscriber("**").callback(|sample| {match sample.kind(){SampleKind::Put => println!(">> [LivelinessSubscriber] New alive token ('{}')",
sample.key_expr().as_str()),SampleKind::Delete => println!(">> [LivelinessSubscriber] Dropped token ('{}')",
sample.key_expr().as_str()),}}).await.unwrap();// Create a nodeprintln!("Create a node");let node_token = session.liveliness().declare_token(format!("node")).await.unwrap();// Create a publisherprintln!("Create a publisher");let pub_token = session.liveliness().declare_token(format!("pub")).await.unwrap();// Create subscriberprintln!("Create a subscriber");let sub_token = session.liveliness().declare_token(format!("sub")).await.unwrap();// Destroy a publisherprintln!("Destroy a publisher");
pub_token.undeclare().await.unwrap();println!("Press CTRL-C to undeclare LivelinessToken and quit...");
std::thread::park();
sub_token.undeclare().await.unwrap();
node_token.undeclare().await.unwrap();}
Opening session...2024-08-21T14:44:26.656773Z INFO main ThreadId(01) zenoh::net::runtime: Using ZID: 49758512d68759c06b8cce305e60b6ef2024-08-21T14:44:26.658523Z INFO main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/[fe80::694a:ae45:bf2b:33a0]:338912024-08-21T14:44:26.658551Z INFO main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/192.168.1.140:338912024-08-21T14:44:26.658768Z INFO main ThreadId(01) zenoh::net::runtime::orchestrator: zenohd listening scout messages on 224.0.0.224:7446Create a node>> [LivelinessSubscriber] New alive token ('node')Create a publisher>> [LivelinessSubscriber] New alive token ('pub')Create a subscriber>> [LivelinessSubscriber] New alive token ('sub')Destroy a publisher>> [LivelinessSubscriber] Dropped token ('pub')>> [LivelinessSubscriber] Dropped token ('node')>> [LivelinessSubscriber] Dropped token ('sub')Press CTRL-C to undeclare LivelinessToken and quit...
Describe the bug
A local liveliness token undeclaration will trigger the other token undeclaration in a chain reaction.
To reproduce
System info
The text was updated successfully, but these errors were encountered: