Interface of a thread-safe notification with a single asynchronous listener. More...
#include <notifier.hpp>
Public Member Functions | |
| virtual void | Notify ()=0 |
| Signals the listener from any thread. | |
| virtual TFuture< void > | Wait ()=0 |
| Asynchronously waits for and consumes a notification. | |
Interface of a thread-safe notification with a single asynchronous listener.
Code that must not depend on the poller type holds an INotifier. The concrete implementation is TNotifier.
|
pure virtual |
Signals the listener from any thread.
Only the first call writes to the wakeup descriptor until the listener consumes the signal. A notification sent before Wait() is retained.
Implemented in NNet::TNotifier< TPoller >.
|
pure virtual |
Asynchronously waits for and consumes a notification.
Call on the poller thread, with at most one outstanding wait. The caller must check all available work after waking because notifications coalesce. Destroying an unfinished future cancels its wait on the poller thread.
| std::logic_error | if another wait is already outstanding. |
Implemented in NNet::TNotifier< TPoller >.