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

Advanced pub sub #854

Merged
merged 22 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions build-resources/opaque-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use zenoh::{
config::Config,
handlers::{FifoChannelHandler, RingChannelHandler},
key_expr::KeyExpr,
liveliness::LivelinessToken,
pubsub::{Publisher, Subscriber},
query::{Query, Queryable, Reply, ReplyError},
sample::Sample,
Expand All @@ -23,10 +24,8 @@ use zenoh::{
};
#[cfg(feature = "unstable")]
use zenoh::{
matching::MatchingListener, query::Querier, sample::SourceInfo,
session::EntityGlobalId,
matching::MatchingListener, query::Querier, sample::SourceInfo, session::EntityGlobalId,
};
use zenoh::liveliness::LivelinessToken;
#[cfg(all(feature = "shared-memory", feature = "unstable"))]
use zenoh::{
shm::zshm, shm::zshmmut, shm::AllocLayout, shm::ChunkAllocResult, shm::ChunkDescriptor,
Expand Down Expand Up @@ -159,6 +158,51 @@ get_opaque_type_data!(
ze_loaned_querying_subscriber_t
);

#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief An owned Zenoh advanced subscriber.
///
/// In addition to receiving the data it is subscribed to,
/// it is also able to receive notifications regarding missed samples and/or automatically recover them.
get_opaque_type_data!(
Option<zenoh_ext::AdvancedSubscriber<()>>,
ze_owned_advanced_subscriber_t
);
#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief A loaned Zenoh advanced subscriber.
get_opaque_type_data!(
zenoh_ext::AdvancedSubscriber<()>,
ze_loaned_advanced_subscriber_t
);
#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief An owned Zenoh sample miss listener. Missed samples can only be detected from advanced publishers, enabling sample miss detection.
///
/// A listener that sends notification when the advanced subscriber misses a sample .
/// Dropping the corresponding subscriber, also drops the listener.
get_opaque_type_data!(
Option<zenoh_ext::SampleMissListener<()>>,
ze_owned_sample_miss_listener_t
);

#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief An owned Zenoh advanced publisher.
///
/// In addition to publishing the data,
/// it also maintains the storage, allowing matching subscribers to retrive missed samples.
get_opaque_type_data!(
Option<zenoh_ext::AdvancedPublisher<'static>>,
ze_owned_advanced_publisher_t
);
#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief A loaned Zenoh advanced publisher.
get_opaque_type_data!(
zenoh_ext::AdvancedPublisher<'static>,
ze_loaned_advanced_publisher_t
);
/// A Zenoh-allocated <a href="https://zenoh.io/docs/manual/abstractions/#key-expression"> key expression </a>.
///
/// Key expressions can identify a single key or a set of keys.
Expand Down Expand Up @@ -197,7 +241,10 @@ get_opaque_type_data!(Session, z_loaned_session_t);

#[cfg(feature = "unstable")]
/// An owned Close handle
get_opaque_type_data!(Option<tokio::task::JoinHandle<zenoh::Result<()>>>, zc_owned_concurrent_close_handle_t);
get_opaque_type_data!(
Option<tokio::task::JoinHandle<zenoh::Result<()>>>,
zc_owned_concurrent_close_handle_t
);

/// An owned Zenoh configuration.
get_opaque_type_data!(Option<Config>, z_owned_config_t);
Expand Down
Loading
Loading