Your opinion will help to improve our service
Leave a feedback >#include <userver/concurrent/queue_helpers.hpp>
Consumer side of concurrent queues.
Definition at line 101 of file queue_helpers.hpp.
Public Member Functions | |
Consumer (const Consumer &)=delete | |
Consumer (Consumer &&) noexcept=default | |
Consumer & | operator= (const Consumer &)=delete |
Consumer & | operator= (Consumer &&other) noexcept |
bool | Pop (ValueType &value, engine::Deadline deadline={}) const |
Pop an element from queue. May wait asynchronously if the queue is empty, but the producer is alive. | |
bool | PopNoblock (ValueType &value) const |
Try to pop an element from queue without blocking. May be used in non-coroutine environment. | |
void | Reset () && |
std::shared_ptr< const QueueType > | Queue () const |
Const access to source queue. | |
|
inline |
Definition at line 120 of file queue_helpers.hpp.
|
inlinenoexcept |
Definition at line 114 of file queue_helpers.hpp.
|
inlinenodiscard |
Pop an element from queue. May wait asynchronously if the queue is empty, but the producer is alive.
false
can be returned before the deadline when the producer is no longer alive. engine::Deadline
is a wrapper over std::chrono::time_point
, not duration
! If you need a timeout, you must reconstruct the deadline in the loop. Definition at line 132 of file queue_helpers.hpp.
|
inlinenodiscard |
Try to pop an element from queue without blocking. May be used in non-coroutine environment.
Definition at line 142 of file queue_helpers.hpp.
|
inlinenodiscard |
Const access to source queue.
Definition at line 154 of file queue_helpers.hpp.
|
inline |
Definition at line 147 of file queue_helpers.hpp.