In iceoryx2 we require an event multiplexing mechanism like the iceoryx waitset. It is connected to Node::wait() and maybe integrated into the Node or a separate mechanism.
ToDo List
[ ] Implement WaitSet
[ ] C and C++ bindings
[ ] Add example how event based communication can look like
Terms
tick - periodic event to produce something
timeout - periodic deadline event to consume something
API
impl WaitSetBuilder {
fn new() -> Self;
fn allocator(); // sets custom allocator to now allocate management stuff on the heap
fn tick(CyclicTimer); // sets tick timeout, whenever wait/run shall emit WaitEvent::Tick
fn create();
}
pub enum Attachment<'a, T: SynchronousMultiplexing> {
Notification(&'a T),
Deadline((&'a T, Duration)),
Tick(Duration),
};
impl WaitSet {
fn attach<T>(attachment: Attachment);
fn run(callback); // runs in a timed loop defined by tick
fn try_run(callback); // no ticks? tries to gather all events.
}
Preconsiderations
Details
SynchronousMultiplexing is a trait implemented by every file descriptor based construct where the file descriptor emits events and can be attached to select, poll or epoll
Every struct that implements SynchronousMultiplexing shall be attachable
Enables the user to implement the trait for sockets and attach them
A Listener port shall be attachable.
Listener ports from different Nodes shall be attachable.
When the app acts as a gateway between 2 isolated iceoryx2 domains the gateway shall wake up whenever it receives a message from one of the domains without requiring multiple threads
Node knows all ports, the first idea was to handle background tasks like Publisher::update_connections() in Node::wait() to deliver the history to newly connected Subscribers
Publisher::update_connections() problem, how is the Subscribers history delivered?
can be handled with cyclic Node::wait(CYCLE_TIME) when the node calls it explicitly for every port - can cause a latency up to CYCLE_TIME
can be handled explicitly by the user - can be error prone when the user has to call this for every publisher
Combine pubsub service with event service with the same name.
specify and reserve an IOX2_SERVICE_UPDATE id and emit this whenever a Subscriber did connect to a service
Node::wait() fetches event internally and calls update_connections() explicitly
requires the user to create the event, attach it and to emit the IOX2_SERVICE_UPDATE event
The WaitSet shall emit signals to handle CTRL+c, SIGINT, SIGTERM events in the same call as additional events
WaitSet shall provide 3 variants: try_wait, timed_wait, blocking_wait
Results
Node::wait() is obsolete?
Create WaitsetBuilder and provide optionally allocator for custom dynamic memory, otherwise use heap
Waitset::attach_fn() must, Waitset::attach()
Aim for
while event = waitset::wait() {
event.call(); // call callback set with `attach_fn()`.
}
Brief feature description
In iceoryx2 we require an event multiplexing mechanism like the iceoryx waitset. It is connected to
Node::wait()
and maybe integrated into theNode
or a separate mechanism.ToDo List
Terms
API
Preconsiderations
Details
SynchronousMultiplexing
is a trait implemented by every file descriptor based construct where the file descriptor emits events and can be attached toselect
,poll
orepoll
SynchronousMultiplexing
shall be attachableListener
port shall be attachable.Listener
ports from differentNode
s shall be attachable.Node
knows all ports, the first idea was to handle background tasks likePublisher::update_connections()
inNode::wait()
to deliver the history to newly connectedSubscriber
sPublisher::update_connections()
problem, how is theSubscriber
s history delivered?Node::wait(CYCLE_TIME)
when the node calls it explicitly for every port - can cause a latency up toCYCLE_TIME
IOX2_SERVICE_UPDATE
id and emit this whenever aSubscriber
did connect to a serviceNode::wait()
fetches event internally and callsupdate_connections()
explicitlyIOX2_SERVICE_UPDATE
eventWaitSet
shall emit signals to handle CTRL+c, SIGINT, SIGTERM events in the same call as additional eventsWaitSet
shall provide 3 variants:try_wait
,timed_wait
,blocking_wait
Results
Node::wait()
is obsolete?WaitsetBuilder
and provide optionally allocator for custom dynamic memory, otherwise use heapWaitset::attach_fn()
must,Waitset::attach()