operator_retry
Resubscribe on error up to the configured retry count.
See Also
- CatchOperator - On error, switch to a recovery observable.
- IntoResultOperator -
Capture next/error signals as
Resultvalues. - LiftResultOperator -
Split
Resultvalues into next and error signals. - ErrorBoundaryOperator -
Enforce
Neveras the error type to guard pipelines at compile time.
Example
Run the example with:
cargo run -p rx_core --example operator_retry_example
let mut retried = concat((
(0..=2).into_observable().map_never(),
throw("error").map_never(),
))
.retry(2);
let _s1 = retried.subscribe(PrintObserver::new("retry_operator"));
Output:
retry_operator - next: 0
retry_operator - next: 1
retry_operator - next: 2
retry_operator - next: 0
retry_operator - next: 1
retry_operator - next: 2
retry_operator - next: 0
retry_operator - next: 1
retry_operator - next: 2
retry_operator - error: "error"
retry_operator - unsubscribed