Package ru.tinkoff.kora.resilient.retry
Interface Retry
public interface Retry
Retry executor implementation
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRetry.RetryRunnable<E extends Throwable>static interfaceRetry State implementation for manual retry execution handlingstatic interfaceRetry.RetrySupplier<T,E extends Throwable> -
Method Summary
Modifier and TypeMethodDescriptionasState()<T> CompletionStage<T>retry(Supplier<CompletionStage<T>> supplier) <E extends Throwable>
voidretry(Retry.RetryRunnable<E> runnable) <T,E extends Throwable>
Tretry(Retry.RetrySupplier<T, E> supplier) <T,E extends Throwable>
Tretry(Retry.RetrySupplier<T, E> supplier, Retry.RetrySupplier<T, E> fallback)
-
Method Details
-
asState
- Returns:
- new
Retry.RetryState
-
retry
<E extends Throwable> void retry(@Nonnull Retry.RetryRunnable<E> runnable) throws RetryExhaustedException, E - Parameters:
runnable- to execute for successful completion- Throws:
RetryExhaustedException- if exhausted all attemptsE extends Throwable
-
retry
<T,E extends Throwable> T retry(@Nonnull Retry.RetrySupplier<T, E> supplier) throws RetryExhaustedException, E- Type Parameters:
T- type of value- Parameters:
supplier- to use for value extraction- Returns:
- value is succeeded
- Throws:
RetryExhaustedException- if exhausted all attemptsE extends Throwable
-
retry
<T,E extends Throwable> T retry(@Nonnull Retry.RetrySupplier<T, E> supplier, Retry.RetrySupplier<T, throws EE> fallback) - Type Parameters:
T- type of value- Parameters:
supplier- to use for value extractionfallback- to use for value if failed to retrieve value from supplier- Returns:
- value is succeeded
- Throws:
E extends Throwable
-
retry
- Type Parameters:
T- type of value- Parameters:
supplier- to use for value extraction- Returns:
- value is succeeded
-