Utility operators are operators that provide some extra functionality without changing of original values, but changing of behaviour. More...
Functions | |
template<schedulers::constraint::scheduler TScheduler> requires is_header_included<debounce_tag, TScheduler> | |
auto | observable::debounce (schedulers::duration period, const TScheduler &scheduler=TScheduler{}) const & |
Only emit emission if specified period of time has passed without any other emission. On each new emission timer reset. | |
template<schedulers::constraint::scheduler TScheduler> requires is_header_included<delay_tag, TScheduler> | |
auto | observable::delay (auto &&delay_duration, TScheduler &&scheduler) const & |
Shift the emissions from an Observable forward in time by a particular amount. | |
template<constraint::observer_of_type< Type > TObs> requires is_header_included <do_tag, TObs> | |
auto | observable::tap (TObs &&observer) const & |
Register an observer to be called when observable provides any events (on_next/on_error/on_completed) | |
template<constraint::on_next_fn< Type > OnNextFn, constraint::on_error_fn OnErrorFn = utils::empty_function_t<std::exception_ptr>, constraint::on_completed_fn OnCompletedFn = utils::empty_function_t<>> requires is_header_included <do_tag, OnNextFn, OnErrorFn, OnCompletedFn> | |
auto | observable::tap (OnNextFn &&on_next, OnErrorFn &&on_error=OnErrorFn{}, OnCompletedFn &&on_completed=OnCompletedFn{}) const & |
Register an list of actions to be called when observable provides any events (on_next/on_error/on_completed) | |
template<constraint::on_next_fn< Type > OnNextFn> requires is_header_included <do_tag, OnNextFn> | |
auto | observable::do_on_next (OnNextFn &&on_next) const & |
Register an callback to be called when observable provides new item (on_next) | |
template<constraint::on_error_fn OnErrorFn> requires is_header_included <do_tag, OnErrorFn> | |
auto | observable::do_on_error (OnErrorFn &&on_error) const & |
Register an callback to be called when observable provides error (on_error) | |
template<constraint::on_completed_fn OnCompletedFn> requires is_header_included <do_tag, OnCompletedFn> | |
auto | observable::do_on_completed (OnCompletedFn &&on_completed) const & |
Register an callback to be called when observable provides complete (on_completed) | |
template<schedulers::constraint::scheduler TScheduler> requires is_header_included<observe_on_tag, TScheduler> | |
auto | observable::observe_on (TScheduler &&scheduler) const & |
Emit emissions of observable starting from this point via provided scheduler. | |
template<typename... Args> requires is_header_included<repeat_tag, Args...> | |
auto | observable::repeat (size_t count) const & |
Re-subscribes on current observable provided amount of times when on_completed obtained. | |
template<typename... Args> requires is_header_included<repeat_tag, Args...> | |
auto | observable::repeat () const & |
Re-subscribes on current observable during on_completed infinitely. | |
template<schedulers::constraint::scheduler TScheduler> requires is_header_included<subscribe_on_tag, TScheduler> | |
auto | observable::subscribe_on (const TScheduler &scheduler) const & |
OnSubscribe function for this observable will be scheduled via provided scheduler. | |
template<constraint::observable_of_type< Type > FallbackObs, schedulers::constraint::scheduler TScheduler> requires is_header_included<timeout_tag, FallbackObs, TScheduler> | |
auto | observable::timeout (schedulers::duration period, FallbackObs &&fallback_obs, const TScheduler &scheduler=TScheduler{}) const & |
Forwards emissions from original observable, but subscribes on fallback observable if no any events during specified period of time (since last emission) | |
template<schedulers::constraint::scheduler TScheduler> requires is_header_included<timeout_tag, TScheduler> | |
auto | observable::timeout (schedulers::duration period, const TScheduler &scheduler=TScheduler{}) const & |
Forwards emissions from original observable, but emit error if no any events during specified period of time (since last emission) | |
Utility operators are operators that provide some extra functionality without changing of original values, but changing of behaviour.
|
inline |
Only emit emission if specified period of time has passed without any other emission. On each new emission timer reset.
Actually this operator resets time of last emission, schedules action to send this emission after specified period if no any new emissions till this moment.
period | is duration of time should be passed since emission from original observable without any new emissions to emit this emission. |
scheduler | is scheduler used to run timer for debounce |
shared_ptr
to store last emission and time.
|
inline |
Shift the emissions from an Observable forward in time by a particular amount.
The delay operator modifies its source Observable by pausing for a particular increment of time (that you specify) before emitting each of the source Observable’s items. This has the effect of shifting the entire sequence of items emitted by the Observable forward in time by that specified increment.
Actually this operator just schedules emissions via provided scheduler with provided delay_duration.
delay_duration | is the delay duration for emitting items. Delay duration should be able to cast to rpp::schedulers::duration. |
scheduler | provides the threading model for delay. e.g. With a new thread scheduler, the observer sees the values in a new thread after a delay duration to the subscription. |
shared_ptr
to store internal state
|
inline |
Register an callback to be called when observable provides complete (on_completed)
tap
would be invoked BEFORE on_completed from subscriberon_completed | - action in case of completion |
|
inline |
Register an callback to be called when observable provides error (on_error)
tap
would be invoked BEFORE on_error from subscriberon_error | - action over std::exception_ptr in case of any error |
|
inline |
Register an callback to be called when observable provides new item (on_next)
tap
would be invoked BEFORE on_next from subscriberon_next | - action over new emitted item |
|
inline |
Emit emissions of observable starting from this point via provided scheduler.
Actually this operator just schedules emissions via provided scheduler. So, actually it is delay(0) operator
scheduler | is scheduler used for scheduling of OnNext |
shared_ptr
to store internal state
|
inline |
Re-subscribes on current observable during on_completed
infinitely.
|
inline |
Re-subscribes on current observable provided amount of times when on_completed
obtained.
Actually this operator re-subscribes on same observable when on_completed
obtained while counter not reached zero
count | total amount of times subscription happens. For example:
|
shared_ptr
to store counter
|
inline |
OnSubscribe function for this observable will be scheduled via provided scheduler.
Actually this operator just schedules subscription on original observable to provided scheduler
scheduler | is scheduler used for scheduling of OnSubscribe |
|
inline |
Register an list of actions to be called when observable provides any events (on_next/on_error/on_completed)
tap
would be invoked BEFORE subscribed subscriberon_next | - action over new emitted item |
on_error | - action over std::exception_ptr in case of any error |
on_completed | - action in case of completion |
|
inline |
Register an observer to be called when observable provides any events (on_next/on_error/on_completed)
tap
would be invoked BEFORE subscribed subscriberobserver | - observer which would accept callbacks |
|
inline |
Forwards emissions from original observable, but emit error if no any events during specified period of time (since last emission)
period | is maximum duration between emitted items before a timeout occurs |
scheduler | is scheduler used to run timer for timeout |
|
inline |
Forwards emissions from original observable, but subscribes on fallback observable if no any events during specified period of time (since last emission)
period | is maximum duration between emitted items before a timeout occurs |
fallback_obs | is observable to subscribe on when timeout reached |
scheduler | is scheduler used to run timer for timeout |