Use waitset in pub-sub pattern #683
-
Hi folks- I had a question about using Use case: I'm building an introspection service that continuously performs service discovery (assuming the message type is known). For each newly discovered service, a corresponding service instance and subscriber are created to receive and print the data. A naive approach would be to loop through all subscribers in a busy loop, calling Assuming the publishers do not emit events upon publishing, is there a way to attach subscribers to a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@strawberry-peanut-butter what you try to build sounds quite like what @orecham is currently working on -> #674 It is basically a CLI tool that which offers a service with all the offered services in the system. The service is required for gateways, which I assume is also what you want to build. With iceoryx2, all messaging pattern, except the event messaging patter, are polling base. That means if you want to get notified about updates, you have to combine the publisher with a notifier and the subscriber with a listener. This gives you as a user the flexibility to mix and match the behavior to your needs. Btw, if you want to create an introspection client instead of a gateway, that's also something we are currently working on. |
Beta Was this translation helpful? Give feedback.
@strawberry-peanut-butter record-replay is also on our todo list :)
Depending on the publishing frequency, the queue sizes and how important latency is, it might be more performant to poll all subscriber, e.g. every 10ms. Alternatively, you can use the events with a waitset. Here, you also have to option to reduce context switches on the producer side, by triggering the events only every N transmissions, e.g. if your queue size is 10, send a notification with every 5th sample.
@elfenpiff @orecham you can probably provide more insight into these topics.