public final class RetryWhen extends Object
Func1
parameter of
Observable.retryWhen(Func1)
. 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 |
Constructor and Description |
---|
RetryWhen() |
Modifier and Type | Method and Description |
---|---|
RetryWhen.Builder |
action(rx.functions.Action1<? super RetryWhen.ErrorAndDuration> action) |
static RetryWhen.Builder |
delay(long delay,
TimeUnit unit) |
static RetryWhen.Builder |
delays(rx.Observable<Long> delays,
TimeUnit unit) |
static RetryWhen.Builder |
delaysInt(rx.Observable<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(rx.functions.Func1<Throwable,Boolean> predicate) |
static RetryWhen.Builder |
retryWhenInstanceOf(Class<? extends Throwable>... classes) |
static RetryWhen.Builder |
scheduler(rx.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(rx.functions.Func1<Throwable,Boolean> predicate)
public static RetryWhen.Builder delays(rx.Observable<Long> delays, TimeUnit unit)
public static RetryWhen.Builder delaysInt(rx.Observable<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(rx.Scheduler scheduler)
public RetryWhen.Builder action(rx.functions.Action1<? 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–2016. All rights reserved.