userver: concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType > Class Template Reference
Loading...
Searching...
No Matches
concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType > Class Template Referencefinal

#include <userver/concurrent/queue_helpers.hpp>

Detailed Description

template<typename QueueType, typename ProducerToken, typename EmplaceEnablerType>
class concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >
Warning
A single Producer must not be used from multiple threads concurrently

Definition at line 29 of file queue_helpers.hpp.

Public Member Functions

 Producer (const Producer &)=delete
 
 Producer (Producer &&) noexcept=default
 
Produceroperator= (const Producer &)=delete
 
Produceroperator= (Producer &&other) noexcept
 
bool Push (ValueType &&value, engine::Deadline deadline={}) const
 
bool PushNoblock (ValueType &&value) const
 
void Reset () &&
 
std::shared_ptr< const QueueType > Queue () const
 Const access to source queue.
 

Constructor & Destructor Documentation

◆ ~Producer()

template<typename QueueType , typename ProducerToken , typename EmplaceEnablerType >
concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >::~Producer ( )
inline

Definition at line 47 of file queue_helpers.hpp.

Member Function Documentation

◆ operator=()

template<typename QueueType , typename ProducerToken , typename EmplaceEnablerType >
Producer & concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >::operator= ( Producer< QueueType, ProducerToken, EmplaceEnablerType > && other)
inlinenoexcept

Definition at line 41 of file queue_helpers.hpp.

◆ Push()

template<typename QueueType , typename ProducerToken , typename EmplaceEnablerType >
bool concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >::Push ( ValueType && value,
engine::Deadline deadline = {} ) const
inline

Push element into queue. May wait asynchronously if the queue is full. Leaves the value unmodified if the operation does not succeed.

Returns
whether push succeeded before the deadline and before the task was canceled.

Definition at line 55 of file queue_helpers.hpp.

◆ PushNoblock()

template<typename QueueType , typename ProducerToken , typename EmplaceEnablerType >
bool concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >::PushNoblock ( ValueType && value) const
inline

Try to push element into queue without blocking. May be used in non-coroutine environment. Leaves the value unmodified if the operation does not succeed.

Returns
whether push succeeded.

Definition at line 65 of file queue_helpers.hpp.

◆ Queue()

template<typename QueueType , typename ProducerToken , typename EmplaceEnablerType >
std::shared_ptr< const QueueType > concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >::Queue ( ) const
inline

Const access to source queue.

Definition at line 77 of file queue_helpers.hpp.

◆ Reset()

template<typename QueueType , typename ProducerToken , typename EmplaceEnablerType >
void concurrent::Producer< QueueType, ProducerToken, EmplaceEnablerType >::Reset ( ) &&
inline

Definition at line 70 of file queue_helpers.hpp.


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