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(Callable<CompletableFuture<T>> callable,
RetryPolicy retryPolicy,
Scheduler scheduler)
Invokes the
callable, scheduling retries with the scheduler 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> CompletableFuture<T> |
future(ContextualCallable<CompletableFuture<T>> callable,
RetryPolicy retryPolicy,
Scheduler scheduler)
Invokes the
callable, scheduling retries with the scheduler 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(Callable<T> callable,
RetryPolicy retryPolicy,
Scheduler scheduler)
Invokes the
callable, scheduling retries with the scheduler 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 <T> RecurrentFuture<T> |
get(ContextualCallable<T> callable,
RetryPolicy retryPolicy,
Scheduler scheduler)
Invokes the
callable, scheduling retries with the scheduler 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 RecurrentFuture<?> |
run(ContextualRunnable runnable,
RetryPolicy retryPolicy,
Scheduler scheduler)
Invokes the
runnable, scheduling retries with the scheduler 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. |
static RecurrentFuture<?> |
run(Runnable runnable,
RetryPolicy retryPolicy,
Scheduler scheduler)
Invokes the
runnable, scheduling retries with the scheduler 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(Callable<CompletableFuture<T>> callable, RetryPolicy retryPolicy, Scheduler scheduler)
callable, scheduling retries with the scheduler 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.
Allows asynchronous invocations to manually perform retries or completion via the callable's
AsyncInvocation reference.
If the callable throws an exception or its resulting future is completed with an exception, the invocation
will be retried automatically, else if the retryPolicy has been exceeded the resulting future will be
completed exceptionally.
For non-exceptional results, retries or completion can be performed manually via the callable's
AsyncInvocation reference.
public static <T> CompletableFuture<T> future(ContextualCallable<CompletableFuture<T>> callable, RetryPolicy retryPolicy, Scheduler scheduler)
callable, scheduling retries with the scheduler according to the retryPolicy.
Allows asynchronous invocations to manually perform retries or completion via the callable's
AsyncInvocation reference.
If the callable throws an exception or its resulting future is completed with an exception, the invocation
will be retried automatically, else if the retryPolicy has been exceeded the resulting future will be
completed exceptionally.
For non-exceptional results, retries or completion can be performed manually via the callable's
AsyncInvocation reference.
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(Callable<T> callable, RetryPolicy retryPolicy, Scheduler scheduler)
callable, scheduling retries with the scheduler 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.
Allows asynchronous invocations to manually perform retries or completion via the callable's
AsyncInvocation reference.
If the callable throws an exception, the invocation will be retried automatically, else if the
retryPolicy has been exceeded the resulting future will be completed exceptionally.
For non-exceptional results, retries or completion can be performed manually via the callable's
AsyncInvocation reference.
public static <T> RecurrentFuture<T> get(ContextualCallable<T> callable, RetryPolicy retryPolicy, Scheduler scheduler)
callable, scheduling retries with the scheduler according to the retryPolicy.
Allows asynchronous invocations to manually perform retries or completion via the callable's
AsyncInvocation reference.
If the callable throws an exception, the invocation will be retried automatically, else if the
retryPolicy has been exceeded the resulting future will be completed exceptionally.
For non-exceptional results, retries or completion can be performed manually via the callable's
AsyncInvocation reference.
public static RecurrentFuture<?> run(ContextualRunnable runnable, RetryPolicy retryPolicy, ScheduledExecutorService executor)
runnable, scheduling retries with the executor according to the retryPolicy.
Allows asynchronous invocations to manually perform retries or completion via the runnable's
AsyncInvocation reference.
If the runnable throws an exception, the invocation will be retried automatically, else if the
retryPolicy has been exceeded the resulting future will be completed exceptionally.
For non-exceptional results, retries or completion can be performed manually via the runnable's
AsyncInvocation reference.
public static RecurrentFuture<?> run(ContextualRunnable runnable, RetryPolicy retryPolicy, Scheduler scheduler)
runnable, scheduling retries with the scheduler according to the retryPolicy.
Allows asynchronous invocations to manually perform retries or completion via the runnable's
AsyncInvocation reference.
If the runnable throws an exception, the invocation will be retried automatically, else if the
retryPolicy has been exceeded the resulting future will be completed exceptionally.
For non-exceptional results, retries or completion can be performed manually via the runnable's
AsyncInvocation reference.
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.public static RecurrentFuture<?> run(Runnable runnable, RetryPolicy retryPolicy, Scheduler scheduler)
runnable, scheduling retries with the scheduler according to the retryPolicy.Copyright © 2015. All Rights Reserved.