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.
|
| template<class... AN> |
| auto | rxcpp::operators::timeout (AN &&...an) -> operator_factory< timeout_tag, AN... > |
| | Return an observable that terminates with timeout_error if a particular timespan has passed without emitting another item from the source observable. More...
|
| |
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
using namespace std::chrono;
.take(3)
.timeout(milliseconds(200));
values.
[](long v) { printf("OnNext: %ld\n", v); },
[](std::exception_ptr ep) {
try {
std::rethrow_exception(ep);
printf("OnError: %s\n", ex.what());
}
},
[]() { printf("OnCompleted\n"); });
OnNext: 1
OnNext: 2
OnNext: 3
OnNext: 1
| #define RXCPP_OPERATORS_RX_TIMEOUT_HPP |