C++ Actor Framework 0.19
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
caf::flow::op::merge_sub< T > Class Template Reference

Receives observables from the pre-merge step and merges their inputs for the observer. More...

#include <merge.hpp>

Inheritance diagram for caf::flow::op::merge_sub< T >:
caf::flow::subscription::impl_base caf::detail::plain_ref_counted caf::flow::subscription::impl caf::disposable::impl

Public Types

using input_key = size_t
 
using input_map = unordered_flat_map< input_key, subscription >
 
using item_queue = std::deque< item_t >
 

Public Member Functions

 merge_sub (coordinator *ctx, observer< T > out, size_t max_concurrent, size_t max_pending_per_input=default_max_pending_per_input)
 
void ref_coordinated () const noexcept override
 
void deref_coordinated () const noexcept override
 
void on_next (const observable< T > &what) override
 
void on_error (const error &what) override
 
void on_complete () override
 
void on_subscribe (flow::subscription sub) override
 
void fwd_on_subscribe (input_key key, subscription sub)
 
void fwd_on_complete (input_key key)
 
void fwd_on_error (input_key key, const error &what)
 
void fwd_on_next (input_key key, const T &item)
 
bool disposed () const noexcept override
 
void dispose () override
 
void request (size_t n) override
 Signals demand for n more items.
 
size_t buffered () const noexcept
 
- Public Member Functions inherited from caf::flow::subscription::impl_base
void ref_disposable () const noexcept final
 
void deref_disposable () const noexcept final
 
- Public Member Functions inherited from caf::detail::plain_ref_counted
 plain_ref_counted (const plain_ref_counted &)
 
plain_ref_countedoperator= (const plain_ref_counted &)
 
void ref () const noexcept
 Increases reference count by one.
 
void deref () const noexcept
 Decreases reference count by one and calls request_deletion when it drops to zero.
 
bool unique () const noexcept
 Queries whether there is exactly one reference.
 
size_t get_reference_count () const noexcept
 Queries the current reference count for this object.
 
virtual void request (size_t n)=0
 Signals demand for n more items.
 
- Public Member Functions inherited from caf::disposable::impl
virtual void dispose ()=0
 
virtual bool disposed () const noexcept=0
 
disposable as_disposable () noexcept
 
virtual void ref_disposable () const noexcept=0
 
virtual void deref_disposable () const noexcept=0
 

Static Public Attributes

static constexpr size_t default_max_pending_per_input = 8
 Limits how many items the merge operator pulls in per input.
 

Friends

void intrusive_ptr_add_ref (const merge_sub *ptr) noexcept
 
void intrusive_ptr_release (const merge_sub *ptr) noexcept
 

Additional Inherited Members

- Protected Attributes inherited from caf::detail::plain_ref_counted
size_t rc_
 

Detailed Description

template<class T>
class caf::flow::op::merge_sub< T >

Receives observables from the pre-merge step and merges their inputs for the observer.

Member Function Documentation

◆ dispose()

template<class T >
void caf::flow::op::merge_sub< T >::dispose ( )
overridevirtual

Implements caf::disposable::impl.

◆ disposed()

template<class T >
bool caf::flow::op::merge_sub< T >::disposed ( ) const
overridevirtualnoexcept

Implements caf::disposable::impl.

◆ request()

template<class T >
void caf::flow::op::merge_sub< T >::request ( size_t  n)
overridevirtual

Signals demand for n more items.

Implements caf::flow::subscription::impl.

Member Data Documentation

◆ default_max_pending_per_input

template<class T >
constexpr size_t caf::flow::op::merge_sub< T >::default_max_pending_per_input = 8
staticconstexpr

Limits how many items the merge operator pulls in per input.

This is deliberately small to make sure that we get reasonably small "batches" of items per input to make sure all inputs get their turn.


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