|
libcaf
0.15.5
|
A topic scatterer that delivers data in broadcast fashion to all sinks. More...
#include <broadcast_topic_scatterer.hpp>
Public Types | |
| using | super = topic_scatterer< T, Filter, Select > |
| Base type. | |
Public Types inherited from caf::topic_scatterer< T, Filter, Select > | |
| using | super = buffered_scatterer< T > |
| Base type. | |
| using | filter_type = Filter |
| Identifies a lane inside the downstream. | |
| using | lanes_map = std::map< filter_type, lane > |
Public Types inherited from caf::buffered_scatterer< T > | |
| using | super = stream_scatterer_impl |
| using | value_type = T |
| using | buffer_type = std::deque< value_type > |
| using | chunk_type = std::vector< value_type > |
Public Types inherited from caf::stream_scatterer_impl | |
| using | super = stream_edge_impl< stream_scatterer > |
Public Types inherited from caf::stream_edge_impl< stream_scatterer > | |
| using | super = stream_scatterer |
| using | path_type = typename super::path_type |
Either inbound_path or outbound_path. | |
| using | path_ptr = path_type * |
| A raw pointer to a path. | |
| using | path_ptr_vec = std::vector< path_ptr > |
| Vector of raw pointers (views) of paths. | |
| using | path_ptr_iter = typename path_ptr_vec::iterator |
| Iterator to a vector of raw pointers. | |
| using | path_uptr = std::unique_ptr< path_type > |
| A unique pointer to a path. | |
| using | path_uptr_vec = std::vector< path_uptr > |
| Vector of owning pointers of paths. | |
| using | path_uptr_iter = typename path_uptr_vec::iterator |
| Iterator to a vector of owning pointers. | |
| using | regular_shutdown = typename path_type::regular_shutdown |
Message type for sending graceful shutdowns along the path (either stream_msg::drop or stream_msg::close). More... | |
| using | irregular_shutdown = typename path_type::irregular_shutdown |
Message type for sending errors along the path (either stream_msg::forced_drop or stream_msg::forced_close). More... | |
Public Types inherited from caf::stream_scatterer | |
| using | path_type = outbound_path |
| using | path_ptr = path_type * |
Public Member Functions | |
| broadcast_topic_scatterer (local_actor *selfptr) | |
| long | credit () const override |
| Returns the currently available credit, depending on the policy in use. More... | |
| void | emit_batches () override |
| Sends batches to sinks. | |
Public Member Functions inherited from caf::topic_scatterer< T, Filter, Select > | |
| topic_scatterer (local_actor *selfptr) | |
| bool | remove_path (const stream_id &sid, const actor_addr &x, error reason, bool silent) override |
| Removes a path from the scatterer. | |
| void | add_lane (filter_type f) |
| template<class Handle > | |
| void | set_filter (const stream_id &sid, const Handle &x, filter_type f) |
Sets the filter for x to f and inserts x into the appropriate lane. More... | |
| const lanes_map & | lanes () const |
| Select & | selector () |
| const Select & | selector () const |
Public Member Functions inherited from caf::buffered_scatterer< T > | |
| buffered_scatterer (local_actor *selfptr) | |
| template<class T0 , class... Ts> | |
| void | push (T0 &&x, Ts &&... xs) |
| chunk_type | get_chunk (long n) |
| long | buffered () const override |
| Returns the size of the output buffer. | |
| buffer_type & | buf () |
| const buffer_type & | buf () const |
Public Member Functions inherited from caf::stream_scatterer_impl | |
| stream_scatterer_impl (local_actor *selfptr) | |
| void | abort (error reason) override |
| Removes all paths with an error message. | |
| long | total_credit () const |
Returns the total number (sum) of all credit in paths(). | |
| long | min_credit () const |
Returns the minimum number of credit in paths(). | |
| long | max_credit () const |
Returns the maximum number of credit in paths(). | |
| void | close () override |
| Removes all paths gracefully. | |
| 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 | paths_clean () const override |
Returns true if there is no data pending and no unacknowledged batch on any path. More... | |
| 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... | |
Public Member Functions inherited from caf::stream_edge_impl< stream_scatterer > | |
| stream_edge_impl (local_actor *selfptr) | |
| path_ptr | find (const stream_id &sid, const actor_addr &x) override |
| const path_uptr_vec & | paths () const |
| Returns all available paths. | |
| local_actor * | self () const |
| Returns a pointer to the parent actor. | |
| bool | remove_path (path_uptr_iter i, error reason, bool silent) |
| bool | remove_path (const stream_id &sid, const actor_addr &x, error reason, bool silent) override |
| void | abort (error reason) override |
| long | num_paths () const override |
| bool | closed () const override |
| bool | continuous () const override |
| void | continuous (bool value) override |
| path_ptr | path_at (size_t index) override |
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)). | |
Additional Inherited Members | |
Static Public Member Functions inherited from caf::buffered_scatterer< T > | |
| static chunk_type | get_chunk (buffer_type &buf, long n) |
Static Public Member Functions inherited from caf::stream_scatterer_impl | |
| template<class PathContainer , class F > | |
| static long | fold_credit (const PathContainer &xs, long x0, F f) |
Folds paths() by extracting the open_credit from each path. | |
| template<class PathContainer > | |
| static long | total_credit (const PathContainer &xs) |
Returns the total number (sum) of all credit in xs. | |
| template<class PathContainer > | |
| static long | min_credit (const PathContainer &xs) |
Returns the minimum number of credit in xs. | |
| template<class PathContainer > | |
| static long | max_credit (const PathContainer &xs) |
Static Public Member Functions inherited from caf::stream_edge_impl< stream_scatterer > | |
| static void | sort_by_credit (PathContainer &xs) |
Sorts xs in descending order by available credit. | |
| static T | fold (PathContainer &xs, T init, F f) |
| static path_ptr | find (PathContainer &xs, const stream_id &sid, const Handle &x) |
Finds the path for ptr and returns a pointer to it. | |
| static PathContainer::iterator | iter_find (PathContainer &xs, const stream_id &sid, const Handle &x) |
Finds the path for ptr and returns an iterator to it. | |
Static Public Attributes inherited from caf::stream_edge_impl< stream_scatterer > | |
| static constexpr const auto | aborter_type |
| Stream aborter flag to monitor paths. | |
Protected Member Functions inherited from caf::topic_scatterer< T, Filter, Select > | |
| void | erase_from_lanes (typename super::path_ptr ptr) |
| bool | erase_from_lane (lane &l, typename super::path_ptr ptr) |
| void | fan_out () |
Spreads the content of buf_ to lanes_. | |
| bool | selected (const filter_type &f, const T &x) |
Returns true if x is selected by f, false otherwise. | |
Protected Member Functions inherited from caf::stream_edge_impl< stream_scatterer > | |
| path_ptr | add_path_impl (const stream_id &sid, strong_actor_ptr x) |
| Adds a path to the edge without emitting messages. | |
| void | close_impl (F f) |
Protected Attributes inherited from caf::topic_scatterer< T, Filter, Select > | |
| lanes_map | lanes_ |
| Select | select_ |
Protected Attributes inherited from caf::buffered_scatterer< T > | |
| buffer_type | buf_ |
Protected Attributes inherited from caf::stream_scatterer_impl | |
| long | min_batch_size_ |
| long | max_batch_size_ |
| long | min_buffer_size_ |
| duration | max_batch_delay_ |
Protected Attributes inherited from caf::stream_edge_impl< stream_scatterer > | |
| local_actor * | self_ |
| path_uptr_vec | paths_ |
| bool | continuous_ |
A topic scatterer that delivers data in broadcast fashion to all sinks.
|
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.
1.8.14