public final class RetryWhen extends Object
Function
parameter of
Flowable.retryWhen(Function)
. For example:
o.retryWhen(RetryWhen.maxRetries(4).delay(10, TimeUnit.SECONDS).action(log).build());
or
o.retryWhen(RetryWhen.exponentialBackoff(100, TimeUnit.MILLISECONDS).maxRetries(10).build());
Modifier and Type | Class and Description |
---|---|
static class |
RetryWhen.Builder |
static class |
RetryWhen.ErrorAndDuration |
Modifier and Type | Method and Description |
---|---|
static RetryWhen.Builder |
action(io.reactivex.functions.Consumer<? super RetryWhen.ErrorAndDuration> action) |
static RetryWhen.Builder |
delay(long delay,
TimeUnit unit) |
static RetryWhen.Builder |
delays(io.reactivex.Flowable<Long> delays,
TimeUnit unit) |
static RetryWhen.Builder |
delaysInt(io.reactivex.Flowable<Integer> delays,
TimeUnit unit) |
static RetryWhen.Builder |
exponentialBackoff(long firstDelay,
TimeUnit unit) |
static RetryWhen.Builder |
exponentialBackoff(long firstDelay,
TimeUnit unit,
double factor) |
static RetryWhen.Builder |
failWhenInstanceOf(Class<? extends Throwable>... classes) |
static RetryWhen.Builder |
maxRetries(int maxRetries) |
static RetryWhen.Builder |
retryIf(io.reactivex.functions.Predicate<Throwable> predicate) |
static RetryWhen.Builder |
retryWhenInstanceOf(Class<? extends Throwable>... classes) |
static RetryWhen.Builder |
scheduler(io.reactivex.Scheduler scheduler) |
public static RetryWhen.Builder retryWhenInstanceOf(Class<? extends Throwable>... classes)
public static RetryWhen.Builder failWhenInstanceOf(Class<? extends Throwable>... classes)
public static RetryWhen.Builder retryIf(io.reactivex.functions.Predicate<Throwable> predicate)
public static RetryWhen.Builder delays(io.reactivex.Flowable<Long> delays, TimeUnit unit)
public static RetryWhen.Builder delaysInt(io.reactivex.Flowable<Integer> delays, TimeUnit unit)
public static RetryWhen.Builder delay(long delay, TimeUnit unit)
public static RetryWhen.Builder maxRetries(int maxRetries)
public static RetryWhen.Builder scheduler(io.reactivex.Scheduler scheduler)
public static RetryWhen.Builder action(io.reactivex.functions.Consumer<? super RetryWhen.ErrorAndDuration> action)
public static RetryWhen.Builder exponentialBackoff(long firstDelay, TimeUnit unit, double factor)
public static RetryWhen.Builder exponentialBackoff(long firstDelay, TimeUnit unit)
Copyright © 2013–2020. All rights reserved.