Class Retry
java.lang.Object
co.yellowdog.platform.clients.retry.Retry
Manages retry logic.
This will always use an exponential backoff algorithm with jitter.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Retry.Builder<T> TRetry the given supplier.<T> CompletableFuture<T> retryAsync(Supplier<CompletionStage<T>> retryable) Asynchronously retry the given async supplier.
-
Method Details
-
builder
-
retry
Retry the given supplier. Any exceptions thrown by the supplier will result in a retry.- Type Parameters:
T- the type of the result.- Parameters:
retryable- the supplier to retry.- Returns:
- the result of the supplier.
-
retryAsync
Asynchronously retry the given async supplier. Any exceptions thrown by the supplier will result in a retry.- Type Parameters:
T- the type of the result.- Parameters:
retryable- the async supplier to retry.- Returns:
- the future to wait on for the result.
-