Return an observable that terminates with timeout_error if a particular timespan has passed without emitting another item from the source observable.
More...
Go to the source code of this file.
Return an observable that terminates with timeout_error if a particular timespan has passed without emitting another item from the source observable.
- Template Parameters
-
Duration | the type of time interval. |
Coordination | the type of the scheduler (optional). |
- Parameters
-
period | the period of time wait for another item from the source observable. |
coordination | the scheduler to manage timeout for each event (optional). |
- Returns
- Observable that terminates with an error if a particular timespan has passed without emitting another item from the source observable.
- Sample Code\n
using namespace std::chrono;
.take(3)
.timeout(milliseconds(200));
values.
[](long v) { printf("OnNext: %ld\n", v); },
[](std::exception_ptr ep) {
try {
printf("OnError: %s\n", ex.what());
}
},
[]() { printf("OnCompleted\n"); });
OnNext: 1
OnNext: 2
OnNext: 3
OnNext: 1
◆ RXCPP_OPERATORS_RX_TIMEOUT_HPP
#define RXCPP_OPERATORS_RX_TIMEOUT_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