public final class AsyncRetrier extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_DELAY_MILLIS |
private ScheduledExecutorService |
executorService |
| Modifier | Constructor and Description |
|---|---|
private |
AsyncRetrier(ScheduledExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
static AsyncRetrier |
create(ScheduledExecutorService sleeper) |
private <T> void |
handleFailure(com.google.common.util.concurrent.SettableFuture<T> future,
com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit,
com.google.common.base.Predicate<T> retryCondition,
Throwable t) |
<T> com.google.common.util.concurrent.ListenableFuture<T> |
retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries) |
<T> com.google.common.util.concurrent.ListenableFuture<T> |
retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delayMillis) |
<T> com.google.common.util.concurrent.ListenableFuture<T> |
retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit) |
<T> com.google.common.util.concurrent.ListenableFuture<T> |
retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit,
com.google.common.base.Predicate<T> retryCondition) |
private <T> void |
startRetry(com.google.common.util.concurrent.SettableFuture<T> future,
com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit,
com.google.common.base.Predicate<T> retryCondition) |
public static final long DEFAULT_DELAY_MILLIS
private final ScheduledExecutorService executorService
private AsyncRetrier(ScheduledExecutorService executorService)
public static AsyncRetrier create(ScheduledExecutorService sleeper)
public <T> com.google.common.util.concurrent.ListenableFuture<T> retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries)
public <T> com.google.common.util.concurrent.ListenableFuture<T> retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delayMillis)
public <T> com.google.common.util.concurrent.ListenableFuture<T> retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit)
public <T> com.google.common.util.concurrent.ListenableFuture<T> retry(com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit,
com.google.common.base.Predicate<T> retryCondition)
private <T> void startRetry(com.google.common.util.concurrent.SettableFuture<T> future,
com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit,
com.google.common.base.Predicate<T> retryCondition)
private <T> void handleFailure(com.google.common.util.concurrent.SettableFuture<T> future,
com.google.common.base.Supplier<com.google.common.util.concurrent.ListenableFuture<T>> code,
int retries,
long delay,
TimeUnit timeUnit,
com.google.common.base.Predicate<T> retryCondition,
Throwable t)
Copyright © 2015 Spotify AB. All Rights Reserved.