Package io.github.resilience4j.retry
Interface VavrRetry
public interface VavrRetry
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T,R> io.vavr.CheckedFunction1<T, R> decorateCheckedFunction(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedFunction1<T, R> function) Creates a retryable function.static io.vavr.CheckedRunnabledecorateCheckedRunnable(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedRunnable runnable) Creates a retryable runnable.static <T> io.vavr.CheckedFunction0<T>decorateCheckedSupplier(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedFunction0<T> supplier) Creates a retryable supplier.decorateEitherSupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Either<E, T>> supplier) Creates a retryable supplier.static <T> Supplier<io.vavr.control.Try<T>>decorateTrySupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Try<T>> supplier) Creates a retryable supplier.static <T> TexecuteCheckedSupplier(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedFunction0<T> checkedSupplier) Decorates and executes the decorated Supplier.static <E extends Exception,T>
io.vavr.control.Either<E,T> executeEitherSupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Either<E, T>> supplier) Decorates and executes the decorated Supplier.static <T> io.vavr.control.Try<T>executeTrySupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Try<T>> supplier) Decorates and executes the decorated Supplier.
-
Method Details
-
decorateCheckedSupplier
static <T> io.vavr.CheckedFunction0<T> decorateCheckedSupplier(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedFunction0<T> supplier) Creates a retryable supplier.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
retry- the retry contextsupplier- the original function- Returns:
- a retryable function
-
decorateCheckedRunnable
static io.vavr.CheckedRunnable decorateCheckedRunnable(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedRunnable runnable) Creates a retryable runnable.- Parameters:
retry- the retry contextrunnable- the original runnable- Returns:
- a retryable runnable
-
decorateCheckedFunction
static <T,R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedFunction1<T, R> function) Creates a retryable function.- Type Parameters:
T- the type of the input to the functionR- the result type of the function- Parameters:
retry- the retry contextfunction- the original function- Returns:
- a retryable function
-
decorateEitherSupplier
static <E extends Exception,T> Supplier<io.vavr.control.Either<E,T>> decorateEitherSupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Either<E, T>> supplier) Creates a retryable supplier.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
retry- the retry contextsupplier- the original function- Returns:
- a retryable function
-
decorateTrySupplier
static <T> Supplier<io.vavr.control.Try<T>> decorateTrySupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Try<T>> supplier) Creates a retryable supplier.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
retry- the retry contextsupplier- the original function- Returns:
- a retryable function
-
executeCheckedSupplier
static <T> T executeCheckedSupplier(io.github.resilience4j.retry.Retry retry, io.vavr.CheckedFunction0<T> checkedSupplier) throws Throwable Decorates and executes the decorated Supplier.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
checkedSupplier- the original Supplier- Returns:
- the result of the decorated Supplier.
- Throws:
Throwable- if something goes wrong applying this function to the given arguments
-
executeEitherSupplier
static <E extends Exception,T> io.vavr.control.Either<E,T> executeEitherSupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Either<E, T>> supplier) Decorates and executes the decorated Supplier.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
supplier- the original Supplier- Returns:
- the result of the decorated Supplier.
-
executeTrySupplier
static <T> io.vavr.control.Try<T> executeTrySupplier(io.github.resilience4j.retry.Retry retry, Supplier<io.vavr.control.Try<T>> supplier) Decorates and executes the decorated Supplier.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
supplier- the original Supplier- Returns:
- the result of the decorated Supplier.
-