#include <userver/engine/multi_consumer_event.hpp>
A single-producer, multiple-consumers event.
Once the producer sends the event, it remains in the signaled state forever.
Compatible with engine::WaitAny and friends.
Unlike engine::SingleUseEvent, MultiConsumerEvent has multiple consumers, thus a consumer is not allowed to destroy MultiConsumerEvent instance, instead the producer should be responsible for that.
Definition at line 39 of file multi_consumer_event.hpp.
Inheritance diagram for engine::MultiConsumerEvent:Public Member Functions | |
| MultiConsumerEvent (const MultiConsumerEvent &)=delete | |
| MultiConsumerEvent (MultiConsumerEvent &&)=delete | |
| MultiConsumerEvent & | operator= (const MultiConsumerEvent &)=delete |
| MultiConsumerEvent & | operator= (MultiConsumerEvent &&)=delete |
| void | Wait () |
| Waits until the event is in a signaled state. | |
| FutureStatus | WaitUntil (Deadline) |
| Waits until the event is in a signaled state, or the deadline expires, or the current task is cancelled. | |
| void | Send () noexcept |
| bool | IsReady () const noexcept override |
| Returns true if already signaled. | |
|
noexcept |
Sets the signal flag and wakes tasks that wait on it, if any. Send must not be called again.
You can safely invoke Send from outside a coroutine.
| void engine::MultiConsumerEvent::Wait | ( | ) |
Waits until the event is in a signaled state.
| engine::WaitInterruptedException | if the current task is cancelled |