COROIO: NNet::INotifier Class Reference
COROIO
Loading...
Searching...
No Matches
NNet::INotifier Class Referenceabstract

Interface of a thread-safe notification with a single asynchronous listener. More...

#include <notifier.hpp>

Inheritance diagram for NNet::INotifier:
NNet::TNotifier< TPoller >

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.

Detailed Description

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.

Member Function Documentation

◆ Notify()

virtual void NNet::INotifier::Notify ( )
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 >.

◆ Wait()

virtual TFuture< void > NNet::INotifier::Wait ( )
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.

Exceptions
std::logic_errorif another wait is already outstanding.

Implemented in NNet::TNotifier< TPoller >.


The documentation for this class was generated from the following file: