folly::EventBaseAtomicNotificationQueue

Lock-free notification queue of tasks consumed by a single consumer.

Synopsis

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

template<
    typename Task,
    typename Consumer>
class EventBaseAtomicNotificationQueue;

Member Functions

NameDescription
EventBaseAtomicNotificationQueue [constructor]Constructors
~EventBaseAtomicNotificationQueue [destructor] [virtual]Destroys the queue, detaching it from its EventBase.
drain Executes all tasks until the queue is empty. Can be called from consumer thread only.
empty Checks if the queue is empty. Can be called from consumer thread only.
execute Executes one round of tasks. Re-activates the event if more tasks are available. Can be called from consumer thread only.
getMaxReadAtOnce Returns the maximum number of tasks processed in a single round.
putMessage Adds a task into the queue. Can be called from any thread.
setMaxReadAtOnce Set the maximum number of tasks processed in a single round. Can be called from consumer thread only.
size Returns the number of tasks in the queue. Can be called from any thread.
startConsuming Attaches the queue to an EventBase. Can be called from consumer thread only.
startConsumingInternal Attaches the queue to an EventBase. Can be called from consumer thread only.
stopConsuming Detaches the queue from an EventBase. Can be called from consumer thread only.
tryPutMessage Adds a task into the queue unless the max queue size is reached. Returns true iff the task was queued. Can be called from any thread.