|
C++ Actor Framework 1.0.0
|
A multicaster pushes items to any number of subscribers. More...
#include <multicaster.hpp>
Public Types | |
| using | impl_ptr = intrusive_ptr<op::mcast<T>> |
Public Member Functions | |
| multicaster (coordinator *parent) | |
| multicaster (impl_ptr ptr) noexcept | |
| multicaster (multicaster &&) noexcept=default | |
| multicaster & | operator= (multicaster &&) noexcept=default |
| multicaster (const multicaster &)=delete | |
| multicaster & | operator= (const multicaster &)=delete |
| bool | push (const T &item) |
| Pushes an item to all subscribed observers. | |
| template<class Iterator , class Sentinel > | |
| size_t | push (Iterator first, Sentinel last) |
Pushes the items in range [first, last) to all subscribed observers. | |
| size_t | push (std::initializer_list< T > items) |
| Pushes the items from the initializer list to all subscribed observers. | |
| void | close () |
| Closes the publisher, eventually emitting on_complete on all observers. | |
| void | abort (const error &reason) |
| Closes the publisher, eventually emitting on_error on all observers. | |
| size_t | demand () const noexcept |
| Queries how many items the publisher may emit immediately to subscribed observers. | |
| size_t | buffered () const noexcept |
| Queries how many items are currently waiting in a buffer until the observer requests additional items. | |
| bool | has_observers () const noexcept |
| Queries whether there is at least one observer subscribed to the operator. | |
| observable< T > | as_observable () const |
| Converts the publisher to an observable. | |
| disposable | subscribe (observer< T > out) |
| Subscribes a new observer to the output of the publisher. | |
A multicaster pushes items to any number of subscribers.
| bool caf::flow::multicaster< T >::push | ( | const T & | item | ) |
Pushes an item to all subscribed observers.
The publisher drops the item if no subscriber exists.
| size_t caf::flow::multicaster< T >::push | ( | Iterator | first, |
| Sentinel | last ) |
Pushes the items in range [first, last) to all subscribed observers.
The publisher drops the items if no subscriber exists.
| size_t caf::flow::multicaster< T >::push | ( | std::initializer_list< T > | items | ) |
Pushes the items from the initializer list to all subscribed observers.
The publisher drops the items if no subscriber exists.