diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index c494a3a2c..20c743783 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -479,10 +479,17 @@ jobs: internal/scripts/ci_prepare_ubuntu.sh uname -a + - name: Set up Bazel + uses: bazel-contrib/setup-bazel@0.9.1 + - name: Run bazel build + env: + USE_BAZEL_VERSION: "7.4.1" run: bazel build //... - name: Run bazel test + env: + USE_BAZEL_VERSION: "7.4.1" run: bazel test //... grcov: diff --git a/iceoryx2-ffi/ffi/src/api/waitset.rs b/iceoryx2-ffi/ffi/src/api/waitset.rs index 64494a506..044558773 100644 --- a/iceoryx2-ffi/ffi/src/api/waitset.rs +++ b/iceoryx2-ffi/ffi/src/api/waitset.rs @@ -22,10 +22,10 @@ use crate::{ use super::{iox2_signal_handling_mode_e, AssertNonNullHandle, HandleToType, IntoCInt}; use iceoryx2::{ - port::waitset::{ + service::{ipc, local}, + waitset::{ WaitSet, WaitSetAttachmentError, WaitSetCreateError, WaitSetRunError, WaitSetRunResult, }, - service::{ipc, local}, }; use iceoryx2_bb_derive_macros::StringLiteral; use iceoryx2_bb_elementary::static_assert::*; diff --git a/iceoryx2-ffi/ffi/src/api/waitset_guard.rs b/iceoryx2-ffi/ffi/src/api/waitset_guard.rs index 3b0d308f3..1279a2a0f 100644 --- a/iceoryx2-ffi/ffi/src/api/waitset_guard.rs +++ b/iceoryx2-ffi/ffi/src/api/waitset_guard.rs @@ -15,8 +15,8 @@ use std::mem::ManuallyDrop; use crate::iox2_service_type_e; -use iceoryx2::port::waitset::WaitSetGuard; use iceoryx2::service::{ipc, local}; +use iceoryx2::waitset::WaitSetGuard; use iceoryx2_bb_elementary::static_assert::*; use iceoryx2_ffi_macros::iceoryx2_ffi; diff --git a/iceoryx2/src/lib.rs b/iceoryx2/src/lib.rs index f0394987c..2241b8821 100644 --- a/iceoryx2/src/lib.rs +++ b/iceoryx2/src/lib.rs @@ -309,7 +309,7 @@ pub mod sample_mut_uninit; pub mod service; /// Defines how constructs like the [`Node`](crate::node::Node) or the -/// [`WaitSet`](crate::port::waitset::WaitSet) shall handle system signals. +/// [`WaitSet`](crate::waitset::WaitSet) shall handle system signals. pub mod signal_handling_mode; /// Loads a meaninful subset to cover 90% of the iceoryx2 communication use cases. @@ -317,3 +317,7 @@ pub mod prelude; #[doc(hidden)] pub mod testing; + +/// Event handling mechanism to wait on multiple [`Listener`](crate::port::listener::Listener)s +/// in one call, realizing the reactor pattern. (Event multiplexer) +pub mod waitset; diff --git a/iceoryx2/src/port/mod.rs b/iceoryx2/src/port/mod.rs index 07482e2ee..fdbc572bf 100644 --- a/iceoryx2/src/port/mod.rs +++ b/iceoryx2/src/port/mod.rs @@ -31,9 +31,6 @@ pub mod subscriber; /// Interface to perform cyclic updates to the ports. Required to deliver history to new /// participants or to perform other management tasks. pub mod update_connections; -/// Event handling mechanism to wait on multiple [`Listener`](crate::port::listener::Listener)s -/// in one call, realizing the reactor pattern. (Event multiplexer) -pub mod waitset; use crate::port::port_identifiers::*; use crate::service; diff --git a/iceoryx2/src/prelude.rs b/iceoryx2/src/prelude.rs index c515bcb84..77848bdd0 100644 --- a/iceoryx2/src/prelude.rs +++ b/iceoryx2/src/prelude.rs @@ -13,7 +13,6 @@ pub use crate::config::Config; pub use crate::node::{node_name::NodeName, Node, NodeBuilder, NodeState}; pub use crate::port::event_id::EventId; -pub use crate::port::waitset::{WaitSet, WaitSetAttachmentId, WaitSetBuilder, WaitSetGuard}; pub use crate::service::messaging_pattern::MessagingPattern; pub use crate::service::{ attribute::AttributeSet, attribute::AttributeSpecifier, attribute::AttributeVerifier, ipc, @@ -21,6 +20,7 @@ pub use crate::service::{ service_name::ServiceName, Service, ServiceDetails, }; pub use crate::signal_handling_mode::SignalHandlingMode; +pub use crate::waitset::{WaitSet, WaitSetAttachmentId, WaitSetBuilder, WaitSetGuard}; pub use iceoryx2_bb_derive_macros::PlacementDefault; pub use iceoryx2_bb_elementary::alignment::Alignment; pub use iceoryx2_bb_elementary::placement_default::PlacementDefault; diff --git a/iceoryx2/src/port/waitset.rs b/iceoryx2/src/waitset.rs similarity index 97% rename from iceoryx2/src/port/waitset.rs rename to iceoryx2/src/waitset.rs index 877b0f0d7..d64b1d0b5 100644 --- a/iceoryx2/src/port/waitset.rs +++ b/iceoryx2/src/waitset.rs @@ -10,29 +10,29 @@ // // SPDX-License-Identifier: Apache-2.0 OR MIT -//! A [`WaitSet`](crate::port::waitset::WaitSet) is an implementation of an event multiplexer +//! A [`WaitSet`](crate::waitset::WaitSet) is an implementation of an event multiplexer //! (Reactor of the reactor design pattern). It allows the user to attach notifications, //! deadlines or intervals. //! //! * **Notification** - An object that emits an event. Whenever the event is detected the -//! [`WaitSet`](crate::port::waitset::WaitSet) wakes up and informs the user. +//! [`WaitSet`](crate::waitset::WaitSet) wakes up and informs the user. //! Typical use case are gateways, which receives and forwards data whenever new data //! is available. //! * **Deadline** - Like a *Notification* with the exception that the *Deadline* expects an //! event after a certain predefined timeout. If the event does not arrive before the -//! timeout has passed, the [`WaitSet`](crate::port::waitset::WaitSet) wakes up and informs +//! timeout has passed, the [`WaitSet`](crate::waitset::WaitSet) wakes up and informs //! the user that th *Deadline* has missed its timeout. //! Whenever a *Deadline* receives an event, the timeout is reset. //! One example is a sensor that shall send an update every 100ms and the applications requires //! the sensor data latest after 120ms. If after 120ms an update //! is not available the application must wake up and take counter measures. If the update //! arrives within the timeout, the timeout is reset back to 120ms. -//! * **Interval** - An time period after which the [`WaitSet`](crate::port::waitset::WaitSet) +//! * **Interval** - An time period after which the [`WaitSet`](crate::waitset::WaitSet) //! wakes up and informs the user that the time has passed by. //! This is useful when a [`Publisher`](crate::port::publisher::Publisher) shall send an //! heartbeat every 100ms. //! -//! The [`WaitSet`](crate::port::waitset::WaitSet) allows the user to attach multiple +//! The [`WaitSet`](crate::waitset::WaitSet) allows the user to attach multiple //! [`Listener`](crate::port::listener::Listener) from multiple [`Node`](crate::node::Node)s, //! anything that implements //! [`SynchronousMultiplexing`](iceoryx2_bb_posix::file_descriptor_set::SynchronousMultiplexing) @@ -185,14 +185,14 @@ //! # } //! ``` //! -//! ## Using [`WaitSet`](crate::port::waitset::WaitSet) Without [`Signal`](iceoryx2_bb_posix::signal::Signal) Handling +//! ## Using [`WaitSet`](crate::waitset::WaitSet) Without [`Signal`](iceoryx2_bb_posix::signal::Signal) Handling //! -//! This example demonstrates how the [`WaitSet`](crate::port::waitset::WaitSet) can be used when +//! This example demonstrates how the [`WaitSet`](crate::waitset::WaitSet) can be used when //! system signals are being handled elsewhere. The builder parameter -//! [`WaitSetBuilder::signal_handling_mode()`](crate::port::waitset::WaitSetBuilder::signal_handling_mode()) -//! can be used to disable signal handling in all [`WaitSet`](crate::port::waitset::WaitSet) calls -//! like [`WaitSet::wait_and_process()`](crate::port::waitset::WaitSet::wait_and_process()) or -//! [`WaitSet::wait_and_process_once()`](crate::port::waitset::WaitSet::wait_and_process_once()). +//! [`WaitSetBuilder::signal_handling_mode()`](crate::waitset::WaitSetBuilder::signal_handling_mode()) +//! can be used to disable signal handling in all [`WaitSet`](crate::waitset::WaitSet) calls +//! like [`WaitSet::wait_and_process()`](crate::waitset::WaitSet::wait_and_process()) or +//! [`WaitSet::wait_and_process_once()`](crate::waitset::WaitSet::wait_and_process_once()). //! //! ```no_run //! use iceoryx2::prelude::*; diff --git a/iceoryx2/tests/waitset_tests.rs b/iceoryx2/tests/waitset_tests.rs index 5d29a3693..7018dcc6a 100644 --- a/iceoryx2/tests/waitset_tests.rs +++ b/iceoryx2/tests/waitset_tests.rs @@ -16,9 +16,9 @@ mod waitset { use iceoryx2::port::listener::Listener; use iceoryx2::port::notifier::Notifier; - use iceoryx2::port::waitset::{WaitSetAttachmentError, WaitSetRunError}; use iceoryx2::prelude::{WaitSetBuilder, *}; use iceoryx2::testing::*; + use iceoryx2::waitset::{WaitSetAttachmentError, WaitSetRunError}; use iceoryx2_bb_posix::config::test_directory; use iceoryx2_bb_posix::directory::Directory; use iceoryx2_bb_posix::file::Permission;