public interface AsyncRetry
| Modifier and Type | Interface and Description |
|---|---|
static interface |
AsyncRetry.Context |
static interface |
AsyncRetry.EventPublisher
An EventPublisher which subscribes to the reactive stream of RetryEvents and
can be used to register event consumers.
|
static interface |
AsyncRetry.Metrics |
| Modifier and Type | Method and Description |
|---|---|
AsyncRetry.Context |
context()
Creates a retry Context.
|
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateCompletionStage(AsyncRetry retry,
java.util.concurrent.ScheduledExecutorService scheduler,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
Decorates CompletionStageSupplier with Retry
|
default <T> java.util.concurrent.CompletionStage<T> |
executeCompletionStage(java.util.concurrent.ScheduledExecutorService scheduler,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
Decorates and executes the decorated CompletionStage.
|
AsyncRetry.EventPublisher |
getEventPublisher()
Returns an EventPublisher which can be used to register event consumers.
|
AsyncRetry.Metrics |
getMetrics()
Get the Metrics of this RateLimiter.
|
java.lang.String |
getName()
Returns the ID of this Retry.
|
RetryConfig |
getRetryConfig()
Returns the RetryConfig of this Retry.
|
static AsyncRetry |
of(java.lang.String id,
RetryConfig retryConfig)
Creates a Retry with a custom Retry configuration.
|
static AsyncRetry |
of(java.lang.String id,
java.util.function.Supplier<RetryConfig> retryConfigSupplier)
Creates a Retry with a custom Retry configuration.
|
static AsyncRetry |
ofDefaults(java.lang.String id)
Creates a Retry with default configuration.
|
java.lang.String getName()
AsyncRetry.EventPublisher getEventPublisher()
AsyncRetry.Context context()
RetryConfig getRetryConfig()
static AsyncRetry of(java.lang.String id, RetryConfig retryConfig)
id - the ID of the RetryretryConfig - a custom Retry configurationstatic AsyncRetry of(java.lang.String id, java.util.function.Supplier<RetryConfig> retryConfigSupplier)
id - the ID of the RetryretryConfigSupplier - a supplier of a custom Retry configurationstatic AsyncRetry ofDefaults(java.lang.String id)
id - the ID of the Retrydefault <T> java.util.concurrent.CompletionStage<T> executeCompletionStage(java.util.concurrent.ScheduledExecutorService scheduler,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
T - the type of results supplied by this supplierscheduler - execution service to use to schedule retriessupplier - the original CompletionStagestatic <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCompletionStage(AsyncRetry retry, java.util.concurrent.ScheduledExecutorService scheduler, java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
T - type of completion stage resultretry - the retry contextscheduler - execution service to use to schedule retriessupplier - completion stage supplierAsyncRetry.Metrics getMetrics()