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<CompletableFuture<T>> callable)
Executes the
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded. |
<T> CompletableFuture<T> |
future(ContextualCallable<CompletableFuture<T>> callable)
Executes the
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded. |
<T> CompletableFuture<T> |
futureAsync(AsyncCallable<CompletableFuture<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<CompletableFuture<T>> callable)
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded.
Supported on Java 8 and above.
NullPointerException - if the callable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic <T> CompletableFuture<T> future(ContextualCallable<CompletableFuture<T>> callable)
callable asynchronously until the resulting future is successfully completed or the configured
RetryPolicy is exceeded.
Supported on Java 8 and above.
NullPointerException - if the callable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic <T> CompletableFuture<T> futureAsync(AsyncCallable<CompletableFuture<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.
Supported on Java 8 and above.
NullPointerException - if the callable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic <T> FailsafeFuture<T> get(Callable<T> callable)
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded.NullPointerException - if the callable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic <T> FailsafeFuture<T> get(ContextualCallable<T> callable)
callable asynchronously until a successful result is returned or the configured
RetryPolicy is exceeded.NullPointerException - if the callable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic <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.NullPointerException - if the callable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic FailsafeFuture<Void> run(CheckedRunnable runnable)
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded.NullPointerException - if the runnable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic FailsafeFuture<Void> run(ContextualRunnable runnable)
runnable asynchronously until successful or until the configured RetryPolicy is
exceeded.NullPointerException - if the runnable is nullCircuitBreakerOpenException - if a configured circuit breaker is openpublic 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.NullPointerException - if the runnable is nullCircuitBreakerOpenException - if a configured circuit breaker is openCopyright © 2017. All Rights Reserved.