Base class for any observable used in RPP. It handles core callbacks of observable.
More...
|
|
template<typename... Args> |
| | observable (Args &&... args) |
| template<constraint::observer_strategy< Type > ObserverStrategy> |
| void | subscribe (observer< Type, ObserverStrategy > &&observer) const |
| | Subscribes passed observer to emissions from this observable.
|
| void | subscribe (dynamic_observer< Type > observer) const |
| | Subscribe passed observer to emissions from this observable.
|
|
template<constraint::observer_strategy< Type > ObserverStrategy> |
| void | subscribe (ObserverStrategy &&observer_strategy) const |
| | Subscribes passed observer strategy to emissions from this observable via construction of observer.
|
| template<constraint::observer_strategy< Type > ObserverStrategy> |
| composite_disposable_wrapper | subscribe (const composite_disposable_wrapper &d, observer< Type, ObserverStrategy > &&obs) const |
| | Subscribe passed observer to emissions from this observable.
|
| template<constraint::observer_strategy< Type > ObserverStrategy> |
| composite_disposable_wrapper | subscribe (const composite_disposable_wrapper &d, ObserverStrategy &&observer_strategy) const |
| | Subscribes passed observer strategy to emissions from this observable via construction of observer.
|
| template<constraint::observer_strategy< Type > ObserverStrategy> |
| composite_disposable_wrapper | subscribe_with_disposable (observer< Type, ObserverStrategy > &&observer) const |
| | Subscribes passed observer to emissions from this observable.
|
| template<constraint::observer_strategy< Type > ObserverStrategy> |
| composite_disposable_wrapper | subscribe_with_disposable (ObserverStrategy &&observer_strategy) const |
| | Subscribes observer strategy to emissions from this observable.
|
| composite_disposable_wrapper | subscribe_with_disposable (dynamic_observer< Type > observer) const |
| | Subscribe passed observer to emissions from this observable.
|
|
template<std::invocable< Type > OnNext, std::invocable< const std::exception_ptr & > OnError = rpp::utils::rethrow_error_t, std::invocable<> OnCompleted = rpp::utils::empty_function_t<>> |
| void | subscribe (OnNext &&on_next, OnError &&on_error={}, OnCompleted &&on_completed={}) const |
| | Construct rpp::lambda_observer on the fly and subscribe it to emissions from this observable.
|
|
template<std::invocable< Type > OnNext, std::invocable<> OnCompleted> |
| void | subscribe (OnNext &&on_next, OnCompleted &&on_completed) const |
| | Construct rpp::lambda_observer on the fly and subscribe it to emissions from this observable.
|
| template<std::invocable< Type > OnNext, std::invocable< const std::exception_ptr & > OnError = rpp::utils::rethrow_error_t, std::invocable<> OnCompleted = rpp::utils::empty_function_t<>> |
| composite_disposable_wrapper | subscribe_with_disposable (OnNext &&on_next, OnError &&on_error={}, OnCompleted &&on_completed={}) const |
| | Construct rpp::lambda_observer on the fly and subscribe it to emissions from this observable.
|
| template<std::invocable< Type > OnNext, std::invocable<> OnCompleted> |
| composite_disposable_wrapper | subscribe_with_disposable (OnNext &&on_next, OnCompleted &&on_completed) const |
| | Construct rpp::lambda_observer on the fly and subscribe it to emissions from this observable.
|
| template<std::invocable< Type > OnNext, std::invocable< const std::exception_ptr & > OnError = rpp::utils::rethrow_error_t, std::invocable<> OnCompleted = rpp::utils::empty_function_t<>> |
| composite_disposable_wrapper | subscribe (const composite_disposable_wrapper &d, OnNext &&on_next, OnError &&on_error={}, OnCompleted &&on_completed={}) const |
| | Construct rpp::lambda_observer on the fly and subscribe it to emissions from this observable.
|
| template<std::invocable< Type > OnNext, std::invocable<> OnCompleted> |
| composite_disposable_wrapper | subscribe (const composite_disposable_wrapper &d, OnNext &&on_next, OnCompleted &&on_completed) const |
| | Construct rpp::lambda_observer on the fly and subscribe it to emissions from this observable.
|
|
auto | as_dynamic () const & |
| | Convert observable to type-erased version.
|
|
auto | as_dynamic () && |
| | Convert observable to type-erased version.
|
|
template<typename Subscribe> |
| auto | operator| (Subscribe &&op) const |
|
template<typename Op> |
| rpp::constraint::observable auto | operator| (Op &&op) const & |
|
template<typename Op> |
| rpp::constraint::observable auto | operator| (Op &&op) && |
|
template<typename Op> |
| auto | pipe (Op &&op) const & |
|
template<typename Op> |
| auto | pipe (Op &&op) && |
template<constraint::decayed_type Type, constraint::observable_strategy< Type > Strategy>
class rpp::observable< Type, Strategy >
Base class for any observable used in RPP. It handles core callbacks of observable.
Observable provides only one core function: subscribe - it accepts observer (or any way to construct it) and then invokes underlying Strategy to emit emissions somehow.
- Attention
- Actually observable "doesn't emit nothing", it only invokes Strategy! Strategy COULD emit emissions immediately OR place observer to some queue or something like this to obtain emissions later (for example subjects)
-
Expected that observable's strategy would work with observer in serialized way
- Note
- In case of you are need to keep some "abstract" observable of Type, you can use type-erased version: rpp::dynamic_observable
- Template Parameters
-
| Type | of value this observable would provide. Only observers of same type can be subscribed to this observable. |
| Strategy | used to provide logic over observable's callbacks. |