public interface Retryer
Modifier and Type | Method and Description |
---|---|
<T> T |
get(java.util.concurrent.Callable<T> callable)
Executes a
Callable with the context of the retry. |
void |
run(CheckedRunnable runnable)
Executes a
CheckedRunnable with the context of the retry. |
<T> Retryer |
withRetryIf(java.util.function.Predicate<T> predicate)
Optional predicates to be compared against the result of the "get" result of a retry.
|
Retryer |
withRetryOn(java.util.function.Predicate<java.lang.Throwable> throwablePredicate)
Optional predicates to be evaluated before the retryer implementation runs a retry
|
<T> T get(java.util.concurrent.Callable<T> callable)
Callable
with the context of the retry. If the callable throws any exception, then the retryer
will handle that according with the configuration the retryer was created.T
- type returned by provided Callable
callable
- Callable
to be executedvoid run(CheckedRunnable runnable)
CheckedRunnable
with the context of the retry. If the CheckedRunnable
throws any
exception, then the
retryer will handle that according with the configuration the retryer was created.runnable
- CheckedRunnable
to be executedRetryer withRetryOn(java.util.function.Predicate<java.lang.Throwable> throwablePredicate)
throwablePredicate
- Predicate to verify against the exceptions thrown on the retry.<T> Retryer withRetryIf(java.util.function.Predicate<T> predicate)
T
- type accepted by predicatepredicate
- Predicate to verify against the result of the retry.