Result - public final class Retries<Result> extends Object
| Constructor and Description |
|---|
Retries(Retryable<Result> retryable)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
Retries<Result> |
ignoreIfResult(com.google.common.base.Predicate<? super Result> matches)
Specify a skip condition to discard values returned by the Retryable.
|
Retries<Result> |
onEachFailureDo(FailureSubscriber<Result> failureSubscriber)
Perform an arbitrary action after each failed repetition.
|
Retries<Result> |
orElse(Result value)
Specify a default value to return if maximum number repetitions was reached
and no satisfactory value was computed.
|
Result |
perform()
Carry out the retries.
|
Future<Result> |
performAsync()
Carry out the retries asynchronously.
|
Retries<Result> |
stopOnMaxFailures(int maxRetries)
Specify the maximum number of executions.
|
Retries<Result> |
waitAfterFailureAtLeast(int timeout,
TimeUnit timeUnit)
Specify a timeout to wait after each failed repetition.
|
public Retries<Result> stopOnMaxFailures(int maxRetries)
public Retries<Result> orElse(Result value)
public Retries<Result> ignoreIfResult(com.google.common.base.Predicate<? super Result> matches)
public Retries<Result> onEachFailureDo(FailureSubscriber<Result> failureSubscriber)
public Retries<Result> waitAfterFailureAtLeast(int timeout, TimeUnit timeUnit)
public Result perform() throws RetryException
RetryException - if no satisfactory value was computed and no default value was provided.public Future<Result> performAsync()
RetryException - if no satisfactory value was computed and no default value was provided.Copyright © 2015. All rights reserved.