libcaf  0.15.5
Public Types | Public Member Functions | List of all members
caf::stream_scatterer Class Referenceabstract

Type-erased policy for dispatching data to sinks. More...

#include <stream_scatterer.hpp>

Inheritance diagram for caf::stream_scatterer:
caf::fused_scatterer< T, Ts > caf::invalid_stream_scatterer caf::terminal_stream_scatterer caf::stream_edge_impl< stream_scatterer > caf::stream_scatterer_impl caf::buffered_scatterer< T > caf::topic_scatterer< T, Filter, Select > caf::broadcast_topic_scatterer< T, Filter, Select > caf::random_topic_scatterer< T, Filter, Select >

Public Types

using path_type = outbound_path
 
using path_ptr = path_type *
 

Public Member Functions

virtual 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)=0
 Adds a path to the edge. More...
 
virtual path_ptr confirm_path (const stream_id &sid, const actor_addr &from, strong_actor_ptr to, long initial_demand, bool redeployable)=0
 Adds a path to a sink and initiates the handshake.
 
virtual bool remove_path (const stream_id &sid, const actor_addr &x, error reason, bool silent)=0
 Removes a path from the scatterer.
 
virtual bool paths_clean () const =0
 Returns true if there is no data pending and no unacknowledged batch on any path. More...
 
virtual void close ()=0
 Removes all paths gracefully.
 
virtual void abort (error reason)=0
 Removes all paths with an error message.
 
virtual long num_paths () const =0
 Returns the number of paths managed on this edge.
 
virtual bool closed () const =0
 Returns true if no downstream exists, false otherwise.
 
virtual bool continuous () const =0
 Returns whether this edge remains open after the last path is removed.
 
virtual void continuous (bool value)=0
 Sets whether this edge remains open after the last path is removed.
 
virtual void emit_batches ()=0
 Sends batches to sinks.
 
virtual path_ptr find (const stream_id &sid, const actor_addr &x)=0
 Returns the stored state for x if x is a known path and associated to sid, otherwise nullptr. More...
 
virtual path_ptr path_at (size_t index)=0
 Returns the stored state for x if x is a known path and associated to sid, otherwise nullptr. More...
 
virtual long credit () const =0
 Returns the currently available credit, depending on the policy in use. More...
 
virtual long buffered () const =0
 Returns the size of the output buffer.
 
virtual long min_batch_size () const =0
 Minimum amount of messages required to emit a batch. More...
 
virtual long max_batch_size () const =0
 Maximum amount of messages to put into a single batch. More...
 
virtual long min_buffer_size () const =0
 Minimum amount of messages we wish to store at the actor in order to emit new batches immediately when receiving new downstream demand. More...
 
virtual duration max_batch_delay () const =0
 Forces to actor to emit a batch even if the minimum batch size was not reached. More...
 
virtual void min_batch_size (long x)=0
 Minimum amount of messages required to emit a batch. More...
 
virtual void max_batch_size (long x)=0
 Maximum amount of messages to put into a single batch. More...
 
virtual void min_buffer_size (long x)=0
 Minimum amount of messages we wish to store at the actor in order to emit new batches immediately when receiving new downstream demand. More...
 
virtual void max_batch_delay (duration x)=0
 Forces to actor to emit a batch even if the minimum batch size was not reached. More...
 
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

Type-erased policy for dispatching data to sinks.

Member Function Documentation

virtual path_ptr caf::stream_scatterer::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 
)
pure virtual

Adds a path to the edge.

Returns
The added path on success, nullptr otherwise.

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual long caf::stream_scatterer::credit ( ) const
pure virtual

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.

Implemented in caf::fused_scatterer< T, Ts >, caf::terminal_stream_scatterer, caf::invalid_stream_scatterer, caf::broadcast_topic_scatterer< T, Filter, Select >, and caf::random_topic_scatterer< T, Filter, Select >.

virtual path_ptr caf::stream_scatterer::find ( const stream_id &  sid,
const actor_addr x 
)
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual duration caf::stream_scatterer::max_batch_delay ( ) const
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual void caf::stream_scatterer::max_batch_delay ( duration  x)
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual long caf::stream_scatterer::max_batch_size ( ) const
pure virtual

Maximum amount of messages to put into a single batch.

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual void caf::stream_scatterer::max_batch_size ( long  x)
pure virtual

Maximum amount of messages to put into a single batch.

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual long caf::stream_scatterer::min_batch_size ( ) const
pure virtual

Minimum amount of messages required to emit a batch.

A value of 0 disables batch delays.

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual void caf::stream_scatterer::min_batch_size ( long  x)
pure virtual

Minimum amount of messages required to emit a batch.

A value of 0 disables batch delays.

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual long caf::stream_scatterer::min_buffer_size ( ) const
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual void caf::stream_scatterer::min_buffer_size ( long  x)
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual path_ptr caf::stream_scatterer::path_at ( size_t  index)
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::terminal_stream_scatterer, and caf::invalid_stream_scatterer.

virtual bool caf::stream_scatterer::paths_clean ( ) const
pure virtual

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

Implemented in caf::fused_scatterer< T, Ts >, caf::stream_scatterer_impl, and caf::terminal_stream_scatterer.


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