folly::NotificationQueue::tryConsume

Try to immediately pull a message off of the queue, without blocking.

Synopsis

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

bool
tryConsume(MessageT& result);

Description

If a message is immediately available, the result parameter will be updated to contain the message contents and true will be returned.

If no message is available, false will be returned and result will be left unmodified.

Return Value

True if a message was consumed, false otherwise.

Parameters

NameDescription
resultSet to the message contents when one is available.