#include <userver/concurrent/queue.hpp>
template<typename T, typename QueuePolicy>
class concurrent::GenericQueue< T, QueuePolicy >
Queue with single and multi producer/consumer options
- See also
- Synchronization Primitives
- Examples
- samples/tcp_full_duplex_service/tcp_full_duplex_service.cpp.
Definition at line 52 of file queue.hpp.
|
static std::shared_ptr< GenericQueue > | Create (std::size_t max_size=kUnbounded) |
| Create a new queue.
|
|
◆ Consumer
template<typename T , typename QueuePolicy >
Initial value:
Definition at line 84 of file queue.hpp.
◆ MultiConsumer
template<typename T , typename QueuePolicy >
Initial value:
Definition at line 88 of file queue.hpp.
◆ MultiProducer
template<typename T , typename QueuePolicy >
Initial value:
Definition at line 86 of file queue.hpp.
◆ Producer
template<typename T , typename QueuePolicy >
Initial value:
Definition at line 82 of file queue.hpp.
◆ ValueType
template<typename T , typename QueuePolicy >
◆ Create()
template<typename T , typename QueuePolicy >
Create a new queue.
Definition at line 125 of file queue.hpp.
◆ GetConsumer()
template<typename T , typename QueuePolicy >
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 Consumer
s of the same queue to simultaneously write from multiple coroutines/threads.
- Note
Consumer
may outlive the queue and producers.
Definition at line 163 of file queue.hpp.
◆ GetMultiConsumer()
template<typename T , typename QueuePolicy >
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 177 of file queue.hpp.
◆ GetMultiProducer()
template<typename T , typename QueuePolicy >
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 150 of file queue.hpp.
◆ GetProducer()
template<typename T , typename QueuePolicy >
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 136 of file queue.hpp.
◆ GetSizeApproximate()
template<typename T , typename QueuePolicy >
Gets the approximate size of queue.
Definition at line 194 of file queue.hpp.
◆ GetSoftMaxSize()
template<typename T , typename QueuePolicy >
Gets the limit on the queue size.
Definition at line 191 of file queue.hpp.
◆ SetSoftMaxSize()
template<typename T , typename QueuePolicy >
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 186 of file queue.hpp.
◆ Consumer< GenericQueue, ConsumerToken, EmplaceEnabler >
template<typename T , typename QueuePolicy >
◆ Consumer< GenericQueue, MultiConsumerToken, EmplaceEnabler >
template<typename T , typename QueuePolicy >
◆ Producer< GenericQueue, MultiProducerToken, EmplaceEnabler >
template<typename T , typename QueuePolicy >
◆ Producer< GenericQueue, ProducerToken, EmplaceEnabler >
template<typename T , typename QueuePolicy >
◆ kUnbounded
template<typename T , typename QueuePolicy >
Initial value:=
std::numeric_limits<std::size_t>::max() / 4
Definition at line 91 of file queue.hpp.
The documentation for this class was generated from the following file: