Creational operators are operators that create new observable. More...
Functions | |
template<constraint::decayed_type Type, constraint::on_subscribe_fn< Type > OnSubscribeFn> requires rpp::details::is_header_included<rpp::details::create_tag, Type, OnSubscribeFn> | |
auto | rpp::observable::create (OnSubscribeFn &&on_subscribe) |
Creates rpp::specific_observable with passed action as OnSubscribe. | |
template<constraint::decayed_type Type> requires rpp::details::is_header_included<rpp::details::empty_tag, Type> | |
auto | rpp::observable::empty () |
Creates rpp::specific_observable that emits no items but terminates normally. | |
template<constraint::decayed_type Type> requires rpp::details::is_header_included<rpp::details::error_tag, Type> | |
auto | rpp::observable::error (const std::exception_ptr &err) |
Creates rpp::specific_observable that emits no items and terminates with an error. | |
template<memory_model memory_model, typename T , typename ... Ts> requires (rpp::details::is_header_included<rpp::details::just_tag, T, Ts...> && (constraint::decayed_same_as<T, Ts> && ...)) | |
auto | rpp::observable::just (const schedulers::constraint::scheduler auto &scheduler, T &&item, Ts &&...items) |
Creates rpp::specific_observable that emits a particular items and completes. | |
template<memory_model memory_model, typename T , typename ... Ts> requires (rpp::details::is_header_included<rpp::details::just_tag, T, Ts...> && (constraint::decayed_same_as<T, Ts> && ...)) | |
auto | rpp::observable::just (T &&item, Ts &&...items) |
Creates rpp::specific_observable that emits a particular items and completes. | |
template<memory_model memory_model, schedulers::constraint::scheduler TScheduler> requires rpp::details::is_header_included<rpp::details::from_tag, TScheduler > | |
auto | rpp::observable::from_iterable (constraint::iterable auto &&iterable, const TScheduler &scheduler) |
Creates rpp::specific_observable that emits a items from provided iterable. | |
template<memory_model memory_model> requires rpp::details::is_header_included<rpp::details::from_tag, decltype(callable)> | |
auto | rpp::observable::from_callable (std::invocable<> auto &&callable) |
Creates rpp::specific_observable that calls provided callable and emits resulting value of this callable. | |
template<schedulers::constraint::scheduler TScheduler = schedulers::trampoline> requires rpp::details::is_header_included<rpp::details::interval_tag, TScheduler> | |
auto | rpp::observable::interval (schedulers::duration period, const TScheduler &scheduler) |
Creates rpp::specific_observable which emits sequence of size_t every provided time interval. | |
template<schedulers::constraint::scheduler TScheduler = schedulers::trampoline> requires rpp::details::is_header_included<rpp::details::interval_tag, TScheduler> | |
auto | rpp::observable::interval (schedulers::duration first_delay, schedulers::duration period, const TScheduler &scheduler) |
Creates rpp::specific_observable which emits sequence of size_t every provided time interval with first emission after provided delay. | |
template<constraint::decayed_type Type> requires rpp::details::is_header_included<rpp::details::never_tag, Type> | |
auto | rpp::observable::never () |
Creates rpp::specific_observable that emits no items and does not terminate. | |
Creational operators are operators that create new observable.
auto rpp::observable::create | ( | OnSubscribeFn && | on_subscribe | ) |
Creates rpp::specific_observable with passed action as OnSubscribe.
Type | manually specified type of value provided by this observable |
on_subscribe | is action called after subscription on this observable |
auto rpp::observable::empty | ( | ) |
Creates rpp::specific_observable that emits no items but terminates normally.
Type | type of value to specify observable |
auto rpp::observable::error | ( | const std::exception_ptr & | err | ) |
Creates rpp::specific_observable that emits no items and terminates with an error.
Type | type of value to specify observable |
err | exception ptr to be sent to subscriber |
auto rpp::observable::from_callable | ( | std::invocable<> auto && | callable | ) |
Creates rpp::specific_observable that calls provided callable and emits resulting value of this callable.
memory_model | rpp::memory_model strategy used to handle callable |
auto rpp::observable::from_iterable | ( | constraint::iterable auto && | iterable, |
const TScheduler & | scheduler | ||
) |
Creates rpp::specific_observable that emits a items from provided iterable.
memory_model | rpp::memory_model strategy used to handle provided iterable |
scheduler | is scheduler used for scheduling of submissions: next item will be submitted to scheduler when previous one is executed |
iterable | container with values which will be flattened |
auto rpp::observable::interval | ( | schedulers::duration | first_delay, |
schedulers::duration | period, | ||
const TScheduler & | scheduler | ||
) |
Creates rpp::specific_observable which emits sequence of size_t every provided time interval with first emission after provided delay.
first_delay | period which would be used to delay first emission |
period | period which would be used to delay emissions between each other |
scheduler | used for scheduling this periodic emissions |
auto rpp::observable::interval | ( | schedulers::duration | period, |
const TScheduler & | scheduler | ||
) |
Creates rpp::specific_observable which emits sequence of size_t every provided time interval.
\warn First emission also scheduled and delayed with same interval
period | period which would be used to delay emissions between each other |
scheduler | used for scheduling this periodic emissions |
auto rpp::observable::just | ( | const schedulers::constraint::scheduler auto & | scheduler, |
T && | item, | ||
Ts &&... | items | ||
) |
Creates rpp::specific_observable that emits a particular items and completes.
memory_model | rpp::memory_model startegy used to handle provided items |
Scheduler | type of scheduler used for scheduling of submissions: next item will be submitted to scheduler when previous one is executed |
item | first value to be sent |
items | rest values to be sent |
auto rpp::observable::just | ( | T && | item, |
Ts &&... | items | ||
) |
Creates rpp::specific_observable that emits a particular items and completes.
memory_model | rpp::memory_model startegy used to handle provided items |
item | first value to be sent |
items | rest values to be sent |
auto rpp::observable::never | ( | ) |
Creates rpp::specific_observable that emits no items and does not terminate.
Type | type of value to specify observable |