12#include <rpp/sources/fwd.hpp>
14#include <rpp/defs.hpp>
15#include <rpp/observables/observable.hpp>
21 rpp::schedulers::optional_delay_from_this_timepoint operator()(
const auto&
observer, rpp::schedulers::duration period,
size_t& counter)
const
24 return rpp::schedulers::optional_delay_from_this_timepoint{period};
28 template<
typename TScheduler,
typename TimePo
intOrDuration>
31 using value_type = size_t;
34 RPP_NO_UNIQUE_ADDRESS TScheduler scheduler;
35 TimePointOrDuration initial;
36 rpp::schedulers::duration period;
38 template<rpp::constra
int::observer_of_type<value_type> TObs>
39 void subscribe(TObs&&
observer)
const
41 const auto worker = scheduler.create_worker();
49 template<schedulers::constra
int::scheduler TScheduler,
typename TimePo
intOrDuration>
74 template<schedulers::constra
int::scheduler TScheduler>
75 auto interval(rpp::schedulers::duration initial, rpp::schedulers::duration period, TScheduler&& scheduler)
77 return interval_observable<std::decay_t<TScheduler>, rpp::schedulers::duration>{std::forward<TScheduler>(scheduler), initial, period};
90 template<schedulers::constra
int::scheduler TScheduler>
91 auto interval(rpp::schedulers::time_point initial, rpp::schedulers::duration period, TScheduler&& scheduler)
93 return interval_observable<std::decay_t<TScheduler>, rpp::schedulers::time_point>{std::forward<TScheduler>(scheduler), initial, period};
112 template<schedulers::constra
int::scheduler TScheduler>
113 auto interval(rpp::schedulers::duration period, TScheduler&& scheduler)
115 return interval(period, period, std::forward<TScheduler>(scheduler));
void on_next(const Type &v) const noexcept
Observable calls this method to notify observer about new value.
Definition observer.hpp:84
Base class for any observable used in RPP. It handles core callbacks of observable.
Definition observable.hpp:38
Base class for any observer used in RPP. It handles core callbacks of observers. Objects of this clas...
Definition observer.hpp:172
auto interval(rpp::schedulers::duration initial, rpp::schedulers::duration period, TScheduler &&scheduler)
Creates rpp::observable that emits a sequential integer every specified time interval,...
Definition interval.hpp:72
Definition interval.hpp:20
Definition interval.hpp:30
Definition disposables_strategy.hpp:29