- java.lang.Object
-
- mutiny.zero.operators.Retry<T>
-
- Type Parameters:
T
- the elements type
- All Implemented Interfaces:
java.util.concurrent.Flow.Publisher<T>
public class Retry<T> extends java.lang.Object implements java.util.concurrent.Flow.Publisher<T>
AFlow.Publisher
that retries on failure by re-subscribing to its upstream. APredicate
controls when to retry, and when to stop retrying.Note: this retry operator does not perform advanced time-based re-subscriptions (e.g., exponential back-off).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.function.Predicate<java.lang.Throwable>
always()
static java.util.function.Predicate<java.lang.Throwable>
atMost(int count)
void
subscribe(java.util.concurrent.Flow.Subscriber<? super T> subscriber)
-
-
-
Constructor Detail
-
Retry
public Retry(java.util.concurrent.Flow.Publisher<T> upstream, java.util.function.Predicate<java.lang.Throwable> retryPredicate)
Build a new retry publisher.- Parameters:
upstream
- the upstream publisherretryPredicate
- the retry predicate
-
-