public final class Recurrent extends Object
RetryPolicy. Asynchronous
retries can optionally be performed on a ContextualRunnable or ContextualCallable which allow
invocations to be manually retried or completed.| Modifier and Type | Method and Description |
|---|---|
static <T> CompletableFuture<T> |
future(Callable<CompletableFuture<T>> callable,
RetryPolicy retryPolicy,
ScheduledExecutorService executor)
Invokes the
callable, scheduling retries with the executor according to the retryPolicy. |
static <T> CompletableFuture<T> |
future(ContextualCallable<CompletableFuture<T>> callable,
RetryPolicy retryPolicy,
ScheduledExecutorService executor)
Invokes the
callable, scheduling retries with the executor according to the retryPolicy. |
static <T> T |
get(Callable<T> callable,
RetryPolicy retryPolicy)
Invokes the
callable, sleeping between invocation attempts according to the retryPolicy. |
static <T> RecurrentFuture<T> |
get(Callable<T> callable,
RetryPolicy retryPolicy,
ScheduledExecutorService executor)
Invokes the
callable, scheduling retries with the executor according to the retryPolicy. |
static <T> RecurrentFuture<T> |
get(ContextualCallable<T> callable,
RetryPolicy retryPolicy,
ScheduledExecutorService executor)
Invokes the
callable, scheduling retries with the executor according to the retryPolicy. |
static RecurrentFuture<?> |
run(ContextualRunnable runnable,
RetryPolicy retryPolicy,
ScheduledExecutorService executor)
Invokes the
runnable, scheduling retries with the executor according to the retryPolicy. |
static void |
run(Runnable runnable,
RetryPolicy retryPolicy)
Invokes the
runnable, sleeping between invocation attempts according to the retryPolicy. |
static RecurrentFuture<?> |
run(Runnable runnable,
RetryPolicy retryPolicy,
ScheduledExecutorService executor)
Invokes the
runnable, scheduling retries with the executor according to the retryPolicy. |
public static <T> CompletableFuture<T> future(Callable<CompletableFuture<T>> callable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
callable, scheduling retries with the executor according to the retryPolicy.public static <T> CompletableFuture<T> future(ContextualCallable<CompletableFuture<T>> callable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
callable, scheduling retries with the executor according to the retryPolicy.public static <T> T get(Callable<T> callable, RetryPolicy retryPolicy)
callable, sleeping between invocation attempts according to the retryPolicy.RuntimeException - if the callable fails and the retry policy is exceeded or if interrupted while
waiting to perform a retry. Checked exceptions, including InterruptedException, are wrapped in
RuntimeException.public static <T> RecurrentFuture<T> get(Callable<T> callable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
callable, scheduling retries with the executor according to the retryPolicy.public static <T> RecurrentFuture<T> get(ContextualCallable<T> callable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
callable, scheduling retries with the executor according to the retryPolicy.public static RecurrentFuture<?> run(ContextualRunnable runnable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
runnable, scheduling retries with the executor according to the retryPolicy.public static void run(Runnable runnable, RetryPolicy retryPolicy)
runnable, sleeping between invocation attempts according to the retryPolicy.RuntimeException - if the callable fails and the retry policy is exceeded or if interrupted while
waiting to perform a retry. Checked exceptions, including InterruptedException, are wrapped in
RuntimeException.public static RecurrentFuture<?> run(Runnable runnable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
runnable, scheduling retries with the executor according to the retryPolicy.Copyright © 2015. All Rights Reserved.