Interface VavrCircuitBreaker
public interface VavrCircuitBreaker
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> io.vavr.CheckedConsumer<T>decorateCheckedConsumer(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedConsumer<T> consumer) Returns a consumer which is decorated by a CircuitBreaker.static <T,R> io.vavr.CheckedFunction1<T, R> decorateCheckedFunction(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedFunction1<T, R> function) Returns a function which is decorated by a CircuitBreaker.static io.vavr.CheckedRunnabledecorateCheckedRunnable(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedRunnable runnable) Returns a runnable which is decorated by a CircuitBreaker.static <T> io.vavr.CheckedFunction0<T>decorateCheckedSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedFunction0<T> supplier) Returns a supplier which is decorated by a CircuitBreaker.decorateEitherSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, Supplier<io.vavr.control.Either<? extends Exception, T>> supplier) Returns a supplier which is decorated by a CircuitBreaker.static <T> Supplier<io.vavr.control.Try<T>>decorateTrySupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, Supplier<io.vavr.control.Try<T>> supplier) Returns a supplier which is decorated by a CircuitBreaker.static voidexecuteCheckedRunnable(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedRunnable runnable) Decorates and executes the decorated Runnable.static <T> TexecuteCheckedSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedFunction0<T> checkedSupplier) Decorates and executes the decorated Supplier.static <T> io.vavr.control.Either<Exception,T> executeEitherSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, Supplier<io.vavr.control.Either<? extends Exception, T>> supplier) Decorates and executes the decorated Supplier.static <T> io.vavr.control.Try<T>executeTrySupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, 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.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedFunction0<T> supplier) Returns a supplier which is decorated by a CircuitBreaker.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
circuitBreaker- the CircuitBreakersupplier- the original supplier- Returns:
- a supplier which is decorated by a CircuitBreaker.
-
decorateCheckedRunnable
static io.vavr.CheckedRunnable decorateCheckedRunnable(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedRunnable runnable) Returns a runnable which is decorated by a CircuitBreaker.- Parameters:
circuitBreaker- the CircuitBreakerrunnable- the original runnable- Returns:
- a runnable which is decorated by a CircuitBreaker.
-
decorateEitherSupplier
static <T> Supplier<io.vavr.control.Either<Exception,T>> decorateEitherSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, Supplier<io.vavr.control.Either<? extends Exception, T>> supplier) Returns a supplier which is decorated by a CircuitBreaker.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
circuitBreaker- the CircuitBreakersupplier- the original supplier- Returns:
- a supplier which is decorated by a CircuitBreaker.
-
decorateTrySupplier
static <T> Supplier<io.vavr.control.Try<T>> decorateTrySupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, Supplier<io.vavr.control.Try<T>> supplier) Returns a supplier which is decorated by a CircuitBreaker.- Type Parameters:
T- the type of results supplied by this supplier- Parameters:
circuitBreaker- the CircuitBreakersupplier- the original function- Returns:
- a retryable function
-
decorateCheckedConsumer
static <T> io.vavr.CheckedConsumer<T> decorateCheckedConsumer(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedConsumer<T> consumer) Returns a consumer which is decorated by a CircuitBreaker.- Type Parameters:
T- the type of the input to the consumer- Parameters:
circuitBreaker- the CircuitBreakerconsumer- the original consumer- Returns:
- a consumer which is decorated by a CircuitBreaker.
-
decorateCheckedFunction
static <T,R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedFunction1<T, R> function) Returns a function which is decorated by a CircuitBreaker.- Type Parameters:
T- the type of the input to the functionR- the type of the result of the function- Parameters:
circuitBreaker- the CircuitBreakerfunction- the original function- Returns:
- a function which is decorated by a CircuitBreaker.
-
executeEitherSupplier
static <T> io.vavr.control.Either<Exception,T> executeEitherSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, Supplier<io.vavr.control.Either<? extends Exception, 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.circuitbreaker.CircuitBreaker circuitBreaker, 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.
-
executeCheckedSupplier
static <T> T executeCheckedSupplier(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, 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
-
executeCheckedRunnable
static void executeCheckedRunnable(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedRunnable runnable) throws Throwable Decorates and executes the decorated Runnable.- Parameters:
runnable- the original runnable- Throws:
Throwable
-