Are node.wait()s automatically synced for pub and sub processes?
#1222
|
Hi, For the publisher:
For the subscriber:
Here, there are two seperate If we want to immediately recive what the publisher has published, would this be the best practice? |
Replies: 2 comments
|
@kiasar the With iceoryx2, we decoupled the data-flow from the control flow. Publish-Subscribe, Request-Response and Blackboard are data-flow pattern and are polling based. Events are a control flow pattern and can be used to block a thread. If you do not want to do polling, you can combine one of the data-flow pattern with the Event and for example, use a Notifier to send an event each time a sample is published. But be aware, the internal buffer for events is limited, so you might see a warning about dropped events. This is not a problem as long as you use only one event-id, since the Listener is guaranteed to wake up when events start do drop. On the Listener side, you need to read all samples once there is an event. See also https://github.com/eclipse-iceoryx/iceoryx2/tree/main/examples/rust/event_based_communication |
|
Thanks for your answer Mathias. btw excellent project. |
@kiasar the
node.waitcall is just a convenient way to let the process sleep. It does not effect the communication.With iceoryx2, we decoupled the data-flow from the control flow. Publish-Subscribe, Request-Response and Blackboard are data-flow pattern and are polling based. Events are a control flow pattern and can be used to block a thread.
If you do not want to do polling, you can combine one of the data-flow pattern with the Event and for example, use a Notifier to send an event each time a sample is published. But be aware, the internal buffer for events is limited, so you might see a warning about dropped events. This is not a problem as long as you use only one event-id, since the…