R - listener result typepublic class AsyncFailsafe<R> extends AsyncFailsafeConfig<R,AsyncFailsafe<R>>
retry
policy, circuit breaker and
fallback.| Modifier and Type | Method and Description |
|---|---|
<T> CompletableFuture<T> |
future(Callable<? extends CompletionStage<T>> callable)
Executes the
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded. |
<T> CompletableFuture<T> |
future(ContextualCallable<? extends CompletionStage<T>> callable)
Executes the
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded. |
<T> CompletableFuture<T> |
futureAsync(AsyncCallable<? extends CompletionStage<T>> callable)
Executes the
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded. |
<T> FailsafeFuture<T> |
get(Callable<T> callable)
Executes the
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded. |
<T> FailsafeFuture<T> |
get(ContextualCallable<T> callable)
Executes the
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded. |
<T> FailsafeFuture<T> |
getAsync(AsyncCallable<T> callable)
Executes the
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded. |
FailsafeFuture<Void> |
run(CheckedRunnable runnable)
Executes the
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded. |
FailsafeFuture<Void> |
run(ContextualRunnable runnable)
Executes the
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded. |
FailsafeFuture<Void> |
runAsync(AsyncRunnable runnable)
Executes the
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded. |
onAbortAsync, onAbortAsync, onAbortAsync, onCompleteAsync, onCompleteAsync, onFailedAttemptAsync, onFailedAttemptAsync, onFailedAttemptAsync, onFailureAsync, onFailureAsync, onFailureAsync, onRetriesExceededAsync, onRetriesExceededAsync, onRetryAsync, onRetryAsync, onRetryAsync, onSuccessAsync, onSuccessAsynconAbort, onAbort, onAbort, onAbortAsync, onAbortAsync, onAbortAsync, onComplete, onComplete, onCompleteAsync, onCompleteAsync, onFailedAttempt, onFailedAttempt, onFailedAttempt, onFailedAttemptAsync, onFailedAttemptAsync, onFailedAttemptAsync, onFailure, onFailure, onFailure, onFailureAsync, onFailureAsync, onFailureAsync, onRetriesExceeded, onRetriesExceeded, onRetriesExceededAsync, onRetriesExceededAsync, onRetry, onRetry, onRetry, onRetryAsync, onRetryAsync, onRetryAsync, onSuccess, onSuccess, onSuccessAsync, onSuccessAsync, with, with, with, withFallback, withFallback, withFallback, withFallback, withFallback, withFallback, withFallbackpublic <T> CompletableFuture<T> future(Callable<? extends CompletionStage<T>> callable)
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded.
If a configured circuit breaker is open, the resulting future is completed exceptionally with
CircuitBreakerOpenException.
Supported on Java 8 and above.
NullPointerException - if the callable is nullpublic <T> CompletableFuture<T> future(ContextualCallable<? extends CompletionStage<T>> callable)
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded.
If a configured circuit breaker is open, the resulting future is completed exceptionally with
CircuitBreakerOpenException.
Supported on Java 8 and above.
NullPointerException - if the callable is nullpublic <T> CompletableFuture<T> futureAsync(AsyncCallable<? extends CompletionStage<T>> callable)
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded. This method is intended for integration with asynchronous code. Retries must be
manually scheduled via one of the AsyncExecution.retry methods.
If a configured circuit breaker is open, the resulting future is completed exceptionally with
CircuitBreakerOpenException.
Supported on Java 8 and above.
NullPointerException - if the callable is nullpublic <T> FailsafeFuture<T> get(Callable<T> callable)
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded.
If a configured circuit breaker is open, the resulting future is completed with
CircuitBreakerOpenException.
NullPointerException - if the callable is nullpublic <T> FailsafeFuture<T> get(ContextualCallable<T> callable)
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded.
If a configured circuit breaker is open, the resulting future is completed with
CircuitBreakerOpenException.
NullPointerException - if the callable is nullpublic <T> FailsafeFuture<T> getAsync(AsyncCallable<T> callable)
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded. This method is intended for integration with asynchronous code. Retries must be
manually scheduled via one of the AsyncExecution.retry methods.
If a configured circuit breaker is open, the resulting future is completed with
CircuitBreakerOpenException.
NullPointerException - if the callable is nullpublic FailsafeFuture<Void> run(CheckedRunnable runnable)
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded.
If a configured circuit breaker is open, the resulting future is completed with
CircuitBreakerOpenException.
NullPointerException - if the runnable is nullpublic FailsafeFuture<Void> run(ContextualRunnable runnable)
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded.
If a configured circuit breaker is open, the resulting future is completed with
CircuitBreakerOpenException.
NullPointerException - if the runnable is nullpublic FailsafeFuture<Void> runAsync(AsyncRunnable runnable)
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded. This method is intended for integration with asynchronous code. Retries must be manually scheduled via
one of the AsyncExecution.retry methods.
If a configured circuit breaker is open, the resulting future is completed with
CircuitBreakerOpenException.
NullPointerException - if the runnable is nullCopyright © 2018. All rights reserved.