Interface VavrCircuitBreaker


public interface VavrCircuitBreaker
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    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.
    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.CheckedRunnable
    decorateCheckedRunnable(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.
    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.
    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 void
    executeCheckedRunnable(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, io.vavr.CheckedRunnable runnable)
    Decorates and executes the decorated Runnable.
    static <T> T
    executeCheckedSupplier(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 CircuitBreaker
      supplier - 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 CircuitBreaker
      runnable - 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 CircuitBreaker
      supplier - 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 CircuitBreaker
      supplier - 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 CircuitBreaker
      consumer - 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 function
      R - the type of the result of the function
      Parameters:
      circuitBreaker - the CircuitBreaker
      function - 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