libcaf  0.15.5
Public Types | Public Member Functions | List of all members
caf::fused_scatterer< T, Ts > Class Template Reference

A scatterer that delegates to any number of sub-scatterers. More...

#include <fused_scatterer.hpp>

Inheritance diagram for caf::fused_scatterer< T, Ts >:
caf::stream_scatterer

Public Types

using substreams_tuple = std::tuple< T, Ts... >
 
using pointer = stream_scatterer *
 
using const_pointer = const pointer
 
using iterator = pointer *
 
using const_iterator = const pointer *
 
- Public Types inherited from caf::stream_scatterer
using path_type = outbound_path
 
using path_ptr = path_type *
 

Public Member Functions

 fused_scatterer (local_actor *self)
 
path_ptr add_path (const stream_id &sid, strong_actor_ptr origin, strong_actor_ptr sink_ptr, mailbox_element::forwarding_stack stages, message_id handshake_mid, message handshake_data, stream_priority prio, bool redeployable) override
 Adds a path to the edge. More...
 
path_ptr confirm_path (const stream_id &sid, const actor_addr &from, strong_actor_ptr to, long initial_demand, bool redeployable) override
 Adds a path to a sink and initiates the handshake.
 
bool remove_path (const stream_id &sid, const actor_addr &addr, error reason, bool silent) override
 Removes a path from the scatterer.
 
bool paths_clean () const override
 Returns true if there is no data pending and no unacknowledged batch on any path. More...
 
void close () override
 Removes all paths gracefully.
 
void abort (error reason) override
 Removes all paths with an error message.
 
long num_paths () const override
 Returns the number of paths managed on this edge.
 
bool closed () const override
 Returns true if no downstream exists, false otherwise.
 
bool continuous () const override
 Returns whether this edge remains open after the last path is removed.
 
void continuous (bool value) override
 Sets whether this edge remains open after the last path is removed.
 
void emit_batches () override
 Sends batches to sinks.
 
path_ptr find (const stream_id &sid, const actor_addr &x) override
 Returns the stored state for x if x is a known path and associated to sid, otherwise nullptr. More...
 
path_ptr path_at (size_t idx) override
 Returns the stored state for x if x is a known path and associated to sid, otherwise nullptr. More...
 
long credit () const override
 Returns the currently available credit, depending on the policy in use. More...
 
long buffered () const override
 Returns the size of the output buffer.
 
long min_batch_size () const override
 Minimum amount of messages required to emit a batch. More...
 
long max_batch_size () const override
 Maximum amount of messages to put into a single batch. More...
 
long min_buffer_size () const override
 Minimum amount of messages we wish to store at the actor in order to emit new batches immediately when receiving new downstream demand. More...
 
duration max_batch_delay () const override
 Forces to actor to emit a batch even if the minimum batch size was not reached. More...
 
void min_batch_size (long x) override
 Minimum amount of messages required to emit a batch. More...
 
void max_batch_size (long x) override
 Maximum amount of messages to put into a single batch. More...
 
void min_buffer_size (long x) override
 Minimum amount of messages we wish to store at the actor in order to emit new batches immediately when receiving new downstream demand. More...
 
void max_batch_delay (duration x) override
 Forces to actor to emit a batch even if the minimum batch size was not reached. More...
 
template<class... Us>
void push (Us &&...xs)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
T & main_stream ()
 
const T & main_stream () const
 
template<size_t I>
std::tuple_element< I, substreams_tuple >::type & substream ()
 
template<size_t I>
const std::tuple_element< I, substreams_tuple >::type & substream () const
 
stream_scatterersubstream_by_handshake_type (const message &msg)
 
- Public Member Functions inherited from caf::stream_scatterer
bool remove_path (const stream_id &sid, const strong_actor_ptr &x, error reason, bool silent)
 Removes a path from the scatterer.
 
path_ptr find (const stream_id &sid, const strong_actor_ptr &x)
 Convenience function for calling find(x, actor_cast<actor_addr>(x)).
 

Detailed Description

template<class T, class... Ts>
class caf::fused_scatterer< T, Ts >

A scatterer that delegates to any number of sub-scatterers.

Data is only pushed to the main scatterer T per default.

Member Function Documentation

template<class T , class... Ts>
path_ptr caf::fused_scatterer< T, Ts >::add_path ( const stream_id &  sid,
strong_actor_ptr  origin,
strong_actor_ptr  sink_ptr,
mailbox_element::forwarding_stack  stages,
message_id  handshake_mid,
message  handshake_data,
stream_priority  prio,
bool  redeployable 
)
overridevirtual

Adds a path to the edge.

Returns
The added path on success, nullptr otherwise.

Implements caf::stream_scatterer.

template<class T , class... Ts>
long caf::fused_scatterer< T, Ts >::credit ( ) const
overridevirtual

Returns the currently available credit, depending on the policy in use.

For example, a broadcast policy would return the minimum of all available downstream credits.

Implements caf::stream_scatterer.

template<class T , class... Ts>
path_ptr caf::fused_scatterer< T, Ts >::find ( const stream_id &  sid,
const actor_addr x 
)
overridevirtual

Returns the stored state for x if x is a known path and associated to sid, otherwise nullptr.

Implements caf::stream_scatterer.

template<class T , class... Ts>
duration caf::fused_scatterer< T, Ts >::max_batch_delay ( ) const
overridevirtual

Forces to actor to emit a batch even if the minimum batch size was not reached.

Implements caf::stream_scatterer.

template<class T , class... Ts>
void caf::fused_scatterer< T, Ts >::max_batch_delay ( duration  x)
overridevirtual

Forces to actor to emit a batch even if the minimum batch size was not reached.

Implements caf::stream_scatterer.

template<class T , class... Ts>
long caf::fused_scatterer< T, Ts >::max_batch_size ( ) const
overridevirtual

Maximum amount of messages to put into a single batch.

Causes the actor to split a buffer into more batches if necessary.

Implements caf::stream_scatterer.

template<class T , class... Ts>
void caf::fused_scatterer< T, Ts >::max_batch_size ( long  x)
overridevirtual

Maximum amount of messages to put into a single batch.

Causes the actor to split a buffer into more batches if necessary.

Implements caf::stream_scatterer.

template<class T , class... Ts>
long caf::fused_scatterer< T, Ts >::min_batch_size ( ) const
overridevirtual

Minimum amount of messages required to emit a batch.

A value of 0 disables batch delays.

Implements caf::stream_scatterer.

template<class T , class... Ts>
void caf::fused_scatterer< T, Ts >::min_batch_size ( long  x)
overridevirtual

Minimum amount of messages required to emit a batch.

A value of 0 disables batch delays.

Implements caf::stream_scatterer.

template<class T , class... Ts>
long caf::fused_scatterer< T, Ts >::min_buffer_size ( ) const
overridevirtual

Minimum amount of messages we wish to store at the actor in order to emit new batches immediately when receiving new downstream demand.

Implements caf::stream_scatterer.

template<class T , class... Ts>
void caf::fused_scatterer< T, Ts >::min_buffer_size ( long  x)
overridevirtual

Minimum amount of messages we wish to store at the actor in order to emit new batches immediately when receiving new downstream demand.

Implements caf::stream_scatterer.

template<class T , class... Ts>
path_ptr caf::fused_scatterer< T, Ts >::path_at ( size_t  index)
overridevirtual

Returns the stored state for x if x is a known path and associated to sid, otherwise nullptr.

Implements caf::stream_scatterer.

template<class T , class... Ts>
bool caf::fused_scatterer< T, Ts >::paths_clean ( ) const
overridevirtual

Returns true if there is no data pending and no unacknowledged batch on any path.

Implements caf::stream_scatterer.


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