diff --git a/Cargo.lock b/Cargo.lock index ed43560a5..9a2268a6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3511,7 +3511,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "ahash", "async-trait", @@ -3569,7 +3569,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "zenoh-collections", ] @@ -3607,7 +3607,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "serde", "tracing", @@ -3620,12 +3620,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "flume", "json5", @@ -3647,7 +3647,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-global-executor", "lazy_static", @@ -3659,7 +3659,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "aes", "hmac", @@ -3672,7 +3672,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "bincode", "flume", @@ -3691,7 +3691,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3705,7 +3705,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "zenoh-config", @@ -3723,7 +3723,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "flume", @@ -3748,7 +3748,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "base64 0.22.1", @@ -3779,7 +3779,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3798,7 +3798,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "base64 0.22.1", @@ -3829,7 +3829,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3850,7 +3850,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "futures", @@ -3870,7 +3870,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "futures-util", @@ -3891,7 +3891,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "proc-macro2", "quote", @@ -3902,7 +3902,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "libloading", "serde", @@ -3917,7 +3917,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "const_format", "rand", @@ -3932,7 +3932,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "anyhow", ] @@ -3940,7 +3940,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "futures", "lazy_static", @@ -3955,7 +3955,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "bincode", @@ -3979,7 +3979,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "event-listener 5.3.1", "futures", @@ -3993,7 +3993,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "futures", "tokio", @@ -4006,7 +4006,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "crossbeam-utils", @@ -4041,7 +4041,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#983908b35b2a5bc8830b8eccec8025e62d69dc7f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/liveliness_subscriber_history#a2bff82be06af897ec4254e5f4861a101136b0e4" dependencies = [ "async-trait", "const_format", diff --git a/Cargo.toml b/Cargo.toml index cb302083b..9692d2674 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,10 +52,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" , optional = true } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history" , optional = true } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history" } flume = "*" [build-dependencies] diff --git a/Cargo.toml.in b/Cargo.toml.in index c3d6fa1da..32eec6841 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -52,10 +52,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" , optional = true } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history" , optional = true } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/liveliness_subscriber_history" } flume = "*" [build-dependencies] diff --git a/src/liveliness.rs b/src/liveliness.rs index c13f19f66..5181d64bf 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -127,7 +127,7 @@ pub extern "C" fn zc_liveliness_undeclare_token( /// The options for `zc_liveliness_declare_subscriber()` #[repr(C)] pub struct zc_liveliness_subscriber_options_t { - _dummy: u8, + history: bool, } /// Constucts default value for `zc_liveliness_declare_subscriber_options_t`. @@ -135,7 +135,7 @@ pub struct zc_liveliness_subscriber_options_t { pub extern "C" fn zc_liveliness_subscriber_options_default( this: &mut MaybeUninit, ) { - this.write(zc_liveliness_subscriber_options_t { _dummy: 0 }); + this.write(zc_liveliness_subscriber_options_t { history: false }); } /// Declares a subscriber on liveliness tokens that intersect `key_expr`. @@ -153,7 +153,7 @@ pub extern "C" fn zc_liveliness_declare_subscriber( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, callback: &mut z_moved_closure_sample_t, - _options: Option<&mut zc_liveliness_subscriber_options_t>, + options: Option<&mut zc_liveliness_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); @@ -162,6 +162,7 @@ pub extern "C" fn zc_liveliness_declare_subscriber( match session .liveliness() .declare_subscriber(key_expr) + .history(options.is_some_and(|o|o.history)) .callback(move |sample| { let sample = sample.as_loaned_c_type_ref(); z_closure_sample_call(z_closure_sample_loan(&callback), sample)