Interface VavrRetry


public interface VavrRetry
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    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.
    static io.vavr.CheckedRunnable
    decorateCheckedRunnable(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.
    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.
    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> T
    executeCheckedSupplier(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 context
      supplier - 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 context
      runnable - 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 function
      R - the result type of the function
      Parameters:
      retry - the retry context
      function - 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 context
      supplier - 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 context
      supplier - 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.