Return an observable that emits each item emitted by the source observable after the specified delay.
More...
Go to the source code of this file.
Return an observable that emits each item emitted by the source observable after the specified delay.
- Template Parameters
-
Duration | the type of time interval |
Coordination | the type of the scheduler |
- Parameters
-
period | the period of time each item is delayed |
coordination | the scheduler for the delays |
- Returns
- Observable that emits each item emitted by the source observable after the specified delay.
- Sample Code\n
using namespace std::chrono;
auto start = scheduler.now();
auto period = milliseconds(10);
const auto next = [=](const char* s) {
return [=](long v){
auto t = duration_cast<milliseconds>(scheduler.now() - start);
long long int ms = t.count();
printf("[%s @ %lld] OnNext: %ld\n", s, ms, v);
};
};
values.
next(" delayed"),
[](){printf("OnCompleted\n");});
[ delayed @ 10] OnNext: 1
[ delayed @ 20] OnNext: 2
[ delayed @ 30] OnNext: 3
[ delayed @ 40] OnNext: 4
OnCompleted
◆ RXCPP_OPERATORS_RX_DELAY_HPP
#define RXCPP_OPERATORS_RX_DELAY_HPP |
auto interval(Duration period) -> typename std::enable_if< detail::defer_interval< Duration, identity_one_worker >::value, typename detail::defer_interval< Duration, identity_one_worker >::observable_type >::type
Definition: rx-interval.hpp:113