userver: concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide Class Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide Class Referencefinal

Detailed Description

template<typename T, typename QueuePolicy>
class concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide

Definition at line 619 of file queue.hpp.

+ Inheritance diagram for concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide:

Public Types

using ValueType
 
using Producer
 
using Consumer
 
using MultiProducer
 
using MultiConsumer
 

Public Member Functions

 MultiConsumerSide (GenericQueue &queue)
 
template<typename Token>
bool Pop (Token &token, T &value, engine::Deadline deadline)
 
template<typename Token>
bool PopNoblock (Token &token, T &value)
 
void OnElementPushed ()
 
void StopBlockingOnPop ()
 
void ResumeBlockingOnPop ()
 
std::size_t GetElementCount () const
 
Producer GetProducer ()
 
MultiProducer GetMultiProducer ()
 
Consumer GetConsumer ()
 
MultiConsumer GetMultiConsumer ()
 
void SetSoftMaxSize (std::size_t max_size)
 Sets the limit on the queue size, pushes over this limit will block.
 
std::size_t GetSoftMaxSize () const
 Gets the limit on the queue size.
 
std::size_t GetSizeApproximate () const
 Gets the approximate size of queue.
 

Static Public Member Functions

static std::shared_ptr< GenericQueueCreate (std::size_t max_size=kUnbounded)
 Create a new queue.
 

Static Public Attributes

static constexpr std::size_t kUnbounded
 

Member Typedef Documentation

◆ Consumer

using concurrent::GenericQueue< T, QueuePolicy >::Consumer

Definition at line 154 of file queue.hpp.

◆ MultiConsumer

using concurrent::GenericQueue< T, QueuePolicy >::MultiConsumer

Definition at line 156 of file queue.hpp.

◆ MultiProducer

using concurrent::GenericQueue< T, QueuePolicy >::MultiProducer

Definition at line 155 of file queue.hpp.

◆ Producer

using concurrent::GenericQueue< T, QueuePolicy >::Producer

Definition at line 153 of file queue.hpp.

◆ ValueType

using concurrent::GenericQueue< T, QueuePolicy >::ValueType

Definition at line 151 of file queue.hpp.

Constructor & Destructor Documentation

◆ MultiConsumerSide()

template<typename T, typename QueuePolicy>
concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::MultiConsumerSide ( GenericQueue & queue)
inlineexplicit

Definition at line 621 of file queue.hpp.

◆ ~MultiConsumerSide()

template<typename T, typename QueuePolicy>
concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::~MultiConsumerSide ( )
inline

Definition at line 627 of file queue.hpp.

Member Function Documentation

◆ Create()

static std::shared_ptr< GenericQueue > concurrent::GenericQueue< T, QueuePolicy >::Create ( std::size_t max_size = kUnbounded)
inlinestatic

Create a new queue.

Definition at line 191 of file queue.hpp.

◆ GetConsumer()

Consumer concurrent::GenericQueue< T, QueuePolicy >::GetConsumer ( )
inline

Get a Consumer which makes it possible to read items from the queue. Can be called multiple times. The resulting Consumer is not thread-safe, so you have to use multiple Consumers of the same queue to simultaneously write from multiple coroutines/threads.

Note
Consumer may outlive the queue and producers.

Definition at line 227 of file queue.hpp.

◆ GetElementCount()

template<typename T, typename QueuePolicy>
std::size_t concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::GetElementCount ( ) const
inline

Definition at line 646 of file queue.hpp.

◆ GetMultiConsumer()

MultiConsumer concurrent::GenericQueue< T, QueuePolicy >::GetMultiConsumer ( )
inline

Get a MultiConsumer which makes it possible to read items from the queue. Can be called multiple times. The resulting MultiConsumer is thread-safe, so it can be used simultaneously from multiple coroutines/threads.

Note
MultiConsumer may outlive the queue and producers.
Prefer Consumer tokens when possible, because MultiConsumer token incurs some overhead.

Definition at line 241 of file queue.hpp.

◆ GetMultiProducer()

MultiProducer concurrent::GenericQueue< T, QueuePolicy >::GetMultiProducer ( )
inline

Get a MultiProducer which makes it possible to push items into the queue. Can be called multiple times. The resulting MultiProducer is thread-safe, so it can be used simultaneously from multiple coroutines/threads.

Note
MultiProducer may outlive the queue and consumers.
Prefer Producer tokens when possible, because MultiProducer token incurs some overhead.

Definition at line 215 of file queue.hpp.

◆ GetProducer()

Producer concurrent::GenericQueue< T, QueuePolicy >::GetProducer ( )
inline

Get a Producer which makes it possible to push items into the queue. Can be called multiple times. The resulting Producer is not thread-safe, so you have to use multiple Producers of the same queue to simultaneously write from multiple coroutines/threads.

Note
Producer may outlive the queue and consumers.

Definition at line 201 of file queue.hpp.

◆ GetSizeApproximate()

std::size_t concurrent::GenericQueue< T, QueuePolicy >::GetSizeApproximate ( ) const
inline

Gets the approximate size of queue.

Definition at line 255 of file queue.hpp.

◆ GetSoftMaxSize()

std::size_t concurrent::GenericQueue< T, QueuePolicy >::GetSoftMaxSize ( ) const
inline

Gets the limit on the queue size.

Definition at line 252 of file queue.hpp.

◆ OnElementPushed()

template<typename T, typename QueuePolicy>
void concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::OnElementPushed ( )
inline

Definition at line 640 of file queue.hpp.

◆ Pop()

template<typename T, typename QueuePolicy>
template<typename Token>
bool concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::Pop ( Token & token,
T & value,
engine::Deadline deadline )
inlinenodiscard

Definition at line 631 of file queue.hpp.

◆ PopNoblock()

template<typename T, typename QueuePolicy>
template<typename Token>
bool concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::PopNoblock ( Token & token,
T & value )
inlinenodiscard

Definition at line 636 of file queue.hpp.

◆ ResumeBlockingOnPop()

template<typename T, typename QueuePolicy>
void concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::ResumeBlockingOnPop ( )
inline

Definition at line 644 of file queue.hpp.

◆ SetSoftMaxSize()

void concurrent::GenericQueue< T, QueuePolicy >::SetSoftMaxSize ( std::size_t max_size)
inline

Sets the limit on the queue size, pushes over this limit will block.

Note
This is a soft limit and may be slightly overrun under load.

Definition at line 249 of file queue.hpp.

◆ StopBlockingOnPop()

template<typename T, typename QueuePolicy>
void concurrent::GenericQueue< T, QueuePolicy >::MultiConsumerSide::StopBlockingOnPop ( )
inline

Definition at line 642 of file queue.hpp.

Friends And Related Symbol Documentation

◆ Consumer< GenericQueue, ConsumerToken, EmplaceEnabler >

friend class Consumer< GenericQueue, ConsumerToken, EmplaceEnabler >
friend

Definition at line 133 of file queue.hpp.

◆ Consumer< GenericQueue, MultiConsumerToken, EmplaceEnabler >

friend class Consumer< GenericQueue, MultiConsumerToken, EmplaceEnabler >
friend

Definition at line 133 of file queue.hpp.

◆ Producer< GenericQueue, MultiProducerToken, EmplaceEnabler >

friend class Producer< GenericQueue, MultiProducerToken, EmplaceEnabler >
friend

Definition at line 133 of file queue.hpp.

◆ Producer< GenericQueue, ProducerToken, EmplaceEnabler >

friend class Producer< GenericQueue, ProducerToken, EmplaceEnabler >
friend

Definition at line 133 of file queue.hpp.

Member Data Documentation

◆ kUnbounded

std::size_t concurrent::GenericQueue< T, QueuePolicy >::kUnbounded
staticconstexpr

Definition at line 158 of file queue.hpp.


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