C++ Actor Framework 1.0.0
|
Blocking interface for emitting items to an asynchronous consumer. More...
#include <blocking_producer.hpp>
Public Types | |
using | impl_ptr = intrusive_ptr<impl> |
Public Member Functions | |
blocking_producer (const blocking_producer &)=delete | |
blocking_producer & | operator= (const blocking_producer &)=delete |
blocking_producer (blocking_producer &&)=default | |
blocking_producer & | operator= (blocking_producer &&)=default |
blocking_producer (impl_ptr ptr) | |
blocking_producer (spsc_buffer_ptr< T > buf) | |
bool | push (const T &item) |
Pushes an item to the consumer. | |
bool | push (span< const T > items) |
Pushes multiple items to the consumer. | |
void | close () |
void | abort (error reason) |
bool | canceled () const |
Checks whether the consumer canceled its subscription. | |
operator bool () const noexcept | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<class T > | |
blocking_producer< T > | make_blocking_producer (spsc_buffer_ptr< T > buf) |
template<class T > | |
std::optional< blocking_producer< T > > | make_blocking_producer (producer_resource< T > res) |
template<class T > | |
std::pair< blocking_producer< T >, consumer_resource< T > > | make_blocking_producer () |
Blocking interface for emitting items to an asynchronous consumer.
bool caf::async::blocking_producer< T >::push | ( | const T & | item | ) |
Pushes an item to the consumer.
If there is no demand by the consumer to deliver the item, this functions blocks unconditionally.
true
if the item was delivered to the consumer or false
if the consumer no longer receives any additional item. bool caf::async::blocking_producer< T >::push | ( | span< const T > | items | ) |
Pushes multiple items to the consumer.
If there is no demand by the consumer to deliver all items, this functions blocks unconditionally until all items have been delivered.
true
if all items were delivered to the consumer or false
if the consumer no longer receives any additional item.
|
related |
buf != nullptr