C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::async::producer_adapter< T > Class Template Reference

Integrates an SPSC buffer producer into an asynchronous event loop. More...

#include <producer_adapter.hpp>

Public Types

using impl_ptr = intrusive_ptr<impl>
 

Public Member Functions

 producer_adapter (const producer_adapter &)=delete
 
producer_adapteroperator= (const producer_adapter &)=delete
 
 producer_adapter (producer_adapter &&)=default
 
producer_adapteroperator= (producer_adapter &&)=default
 
 producer_adapter (impl_ptr ptr)
 
producer_adapteroperator= (std::nullptr_t)
 
size_t push (const T &item)
 Makes item available to the consumer.
 
size_t push (span< const T > items)
 Makes items available to the consumer.
 
void close ()
 
void abort (error reason)
 
 operator bool () const noexcept
 

Static Public Member Functions

static producer_adapter make (spsc_buffer_ptr< T > buf, execution_context_ptr ctx, action do_resume, action do_cancel)
 
static std::optional< producer_adaptermake (producer_resource< T > res, execution_context_ptr ctx, action do_resume, action do_cancel)
 

Related Symbols

(Note that these are not member symbols.)

template<class T >
producer_adapter< T > make_producer_adapter (spsc_buffer_ptr< T > buf, execution_context_ptr ctx, action do_resume, action do_cancel)
 
template<class T >
std::optional< producer_adapter< T > > make_producer_adapter (producer_resource< T > res, execution_context_ptr ctx, action do_resume, action do_cancel)
 

Detailed Description

template<class T>
class caf::async::producer_adapter< T >

Integrates an SPSC buffer producer into an asynchronous event loop.

Member Function Documentation

◆ make()

template<class T >
static producer_adapter caf::async::producer_adapter< T >::make ( spsc_buffer_ptr< T > buf,
execution_context_ptr ctx,
action do_resume,
action do_cancel )
static
Precondition
buf != nullptr

◆ push() [1/2]

template<class T >
size_t caf::async::producer_adapter< T >::push ( const T & item)

Makes item available to the consumer.

Returns
the remaining demand.

◆ push() [2/2]

template<class T >
size_t caf::async::producer_adapter< T >::push ( span< const T > items)

Makes items available to the consumer.

Returns
the remaining demand.

Friends And Related Symbol Documentation

◆ make_producer_adapter()

template<class T >
producer_adapter< T > make_producer_adapter ( spsc_buffer_ptr< T > buf,
execution_context_ptr ctx,
action do_resume,
action do_cancel )
related
Precondition
buf != nullptr

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