folly::NotificationQueue

Queue used to deliver messages to an EventBase thread.

Synopsis

Declared in <folly/io/async/NotificationQueue.h>

template<typename MessageT>
class NotificationQueue;

Types

NameDescription
Consumer A callback interface for consuming messages from the queue as they arrive.
SimpleConsumer A lightweight consumer that pulls messages without an event loop.

Enums

NameDescription
FdType The type of file descriptor used to signal message availability.

Member Functions

NameDescription
NotificationQueue [constructor]Create a new NotificationQueue.
~NotificationQueue [destructor]Destroys the queue and releases its file descriptors.
checkPid Check that the NotificationQueue is being used from the correct process.
putMessage Unconditionally put a message on the queue.
putMessages Put several messages on the queue.
setMaxQueueSize Set the advisory maximum queue size.
size Returns the current number of messages in the queue.
tryConsume Try to immediately pull a message off of the queue, without blocking.
tryPutMessage Attempt to put a message on the queue if the queue is not already full.
tryPutMessageNoThrow No-throw versions of the above. Instead returns true on success, false on failure.