Interface VavrRateLimiter


public interface VavrRateLimiter
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T, R> io.vavr.CheckedFunction1<T,R>
    decorateCheckedFunction(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction1<T,R> function)
    Creates a function which is restricted by a RateLimiter.
    static <T, R> io.vavr.CheckedFunction1<T,R>
    decorateCheckedFunction(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedFunction1<T,R> function)
    Creates a function which is restricted by a RateLimiter.
    static <T, R> io.vavr.CheckedFunction1<T,R>
    decorateCheckedFunction(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, Function<T,Integer> permitsCalculator, io.vavr.CheckedFunction1<T,R> function)
    Creates a function which is restricted by a RateLimiter.
    static io.vavr.CheckedRunnable
    decorateCheckedRunnable(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedRunnable runnable)
    Creates a runnable which is restricted by a RateLimiter.
    static io.vavr.CheckedRunnable
    decorateCheckedRunnable(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedRunnable runnable)
    Creates a runnable which is restricted by a RateLimiter.
    static <T> io.vavr.CheckedFunction0<T>
    decorateCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction0<T> supplier)
    Creates a supplier which is restricted by a RateLimiter.
    static <T> io.vavr.CheckedFunction0<T>
    decorateCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedFunction0<T> supplier)
    Creates a supplier which is restricted by a RateLimiter.
    static <T> Supplier<io.vavr.control.Either<Exception,T>>
    decorateEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, Supplier<io.vavr.control.Either<? extends Exception,T>> supplier)
    Creates a supplier which is restricted by a RateLimiter.
    static <T> Supplier<io.vavr.control.Either<Exception,T>>
    decorateEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, Supplier<io.vavr.control.Either<? extends Exception,T>> supplier)
    Creates a supplier which is restricted by a RateLimiter.
    static <T> Supplier<io.vavr.control.Try<T>>
    decorateTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, Supplier<io.vavr.control.Try<T>> supplier)
    Creates a supplier which is restricted by a RateLimiter.
    static <T> Supplier<io.vavr.control.Try<T>>
    decorateTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, Supplier<io.vavr.control.Try<T>> supplier)
    Creates a supplier which is restricted by a RateLimiter.
    static <T> T
    executeCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction0<T> checkedSupplier)
    Decorates and executes the decorated Supplier.
    static <T> T
    executeCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedFunction0<T> checkedSupplier)
    Decorates and executes the decorated Supplier.
    static <T> io.vavr.control.Either<Exception,T>
    executeEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, Supplier<io.vavr.control.Either<? extends Exception,T>> supplier)
    Decorates and executes the decorated Supplier.
    static <T> io.vavr.control.Either<Exception,T>
    executeEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, 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.ratelimiter.RateLimiter rateLimiter, int permits, Supplier<io.vavr.control.Try<T>> supplier)
    Decorates and executes the decorated Supplier.
    static <T> io.vavr.control.Try<T>
    executeTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, 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.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedFunction0<T> supplier)
      Creates a supplier which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of results supplied supplier
      Parameters:
      rateLimiter - the RateLimiter
      supplier - the original supplier
      Returns:
      a supplier which is restricted by a RateLimiter.
    • decorateCheckedSupplier

      static <T> io.vavr.CheckedFunction0<T> decorateCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction0<T> supplier)
      Creates a supplier which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of results supplied supplier
      Parameters:
      rateLimiter - the RateLimiter
      permits - number of permits that this call requires
      supplier - the original supplier
      Returns:
      a supplier which is restricted by a RateLimiter.
    • decorateCheckedRunnable

      static io.vavr.CheckedRunnable decorateCheckedRunnable(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedRunnable runnable)
      Creates a runnable which is restricted by a RateLimiter.
      Parameters:
      rateLimiter - the RateLimiter
      runnable - the original runnable
      Returns:
      a runnable which is restricted by a RateLimiter.
    • decorateCheckedRunnable

      static io.vavr.CheckedRunnable decorateCheckedRunnable(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedRunnable runnable)
      Creates a runnable which is restricted by a RateLimiter.
      Parameters:
      rateLimiter - the RateLimiter
      permits - number of permits that this call requires
      runnable - the original runnable
      Returns:
      a runnable which is restricted by a RateLimiter.
    • decorateCheckedFunction

      static <T, R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, io.vavr.CheckedFunction1<T,R> function)
      Creates a function which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of function argument
      R - the type of function results
      Parameters:
      rateLimiter - the RateLimiter
      function - the original function
      Returns:
      a function which is restricted by a RateLimiter.
    • decorateCheckedFunction

      static <T, R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction1<T,R> function)
      Creates a function which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of function argument
      R - the type of function results
      Parameters:
      rateLimiter - the RateLimiter
      permits - number of permits that this call requires
      function - the original function
      Returns:
      a function which is restricted by a RateLimiter.
    • decorateCheckedFunction

      static <T, R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, Function<T,Integer> permitsCalculator, io.vavr.CheckedFunction1<T,R> function)
      Creates a function which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of function argument
      R - the type of function results
      Parameters:
      rateLimiter - the RateLimiter
      permitsCalculator - calculates the number of permits required by this call based on the functions argument
      function - the original function
      Returns:
      a function which is restricted by a RateLimiter.
    • decorateTrySupplier

      static <T> Supplier<io.vavr.control.Try<T>> decorateTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, Supplier<io.vavr.control.Try<T>> supplier)
      Creates a supplier which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of results supplied supplier
      Parameters:
      rateLimiter - the RateLimiter
      supplier - the original supplier
      Returns:
      a supplier which is restricted by a RateLimiter.
    • decorateTrySupplier

      static <T> Supplier<io.vavr.control.Try<T>> decorateTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, Supplier<io.vavr.control.Try<T>> supplier)
      Creates a supplier which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of results supplied supplier
      Parameters:
      rateLimiter - the RateLimiter
      permits - number of permits that this call requires
      supplier - the original supplier
      Returns:
      a supplier which is restricted by a RateLimiter.
    • decorateEitherSupplier

      static <T> Supplier<io.vavr.control.Either<Exception,T>> decorateEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, Supplier<io.vavr.control.Either<? extends Exception,T>> supplier)
      Creates a supplier which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of results supplied supplier
      Parameters:
      rateLimiter - the RateLimiter
      supplier - the original supplier
      Returns:
      a supplier which is restricted by a RateLimiter.
    • decorateEitherSupplier

      static <T> Supplier<io.vavr.control.Either<Exception,T>> decorateEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, Supplier<io.vavr.control.Either<? extends Exception,T>> supplier)
      Creates a supplier which is restricted by a RateLimiter.
      Type Parameters:
      T - the type of results supplied supplier
      Parameters:
      rateLimiter - the RateLimiter
      permits - number of permits that this call requires
      supplier - the original supplier
      Returns:
      a supplier which is restricted by a RateLimiter.
    • executeTrySupplier

      static <T> io.vavr.control.Try<T> executeTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, 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.
    • executeTrySupplier

      static <T> io.vavr.control.Try<T> executeTrySupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, 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:
      permits - number of permits that this call requires
      supplier - the original Supplier
      Returns:
      the result of the decorated Supplier.
    • executeEitherSupplier

      static <T> io.vavr.control.Either<Exception,T> executeEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, 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.
    • executeEitherSupplier

      static <T> io.vavr.control.Either<Exception,T> executeEitherSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, 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:
      permits - number of permits that this call requires
      supplier - the original Supplier
      Returns:
      the result of the decorated Supplier.
    • executeCheckedSupplier

      static <T> T executeCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, 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
    • executeCheckedSupplier

      static <T> T executeCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, 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:
      permits - number of permits that this call requires
      checkedSupplier - the original Supplier
      Returns:
      the result of the decorated Supplier.
      Throws:
      Throwable - if something goes wrong applying this function to the given arguments