Interface VavrRateLimiter
public interface VavrRateLimiter
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <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.CheckedRunnabledecorateCheckedRunnable(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedRunnable runnable) Creates a runnable which is restricted by a RateLimiter.static io.vavr.CheckedRunnabledecorateCheckedRunnable(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.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.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> TexecuteCheckedSupplier(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction0<T> checkedSupplier) Decorates and executes the decorated Supplier.static <T> TexecuteCheckedSupplier(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 RateLimitersupplier- 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 RateLimiterpermits- number of permits that this call requiressupplier- 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 RateLimiterrunnable- 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 RateLimiterpermits- number of permits that this call requiresrunnable- 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 argumentR- the type of function results- Parameters:
rateLimiter- the RateLimiterfunction- 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 argumentR- the type of function results- Parameters:
rateLimiter- the RateLimiterpermits- number of permits that this call requiresfunction- 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 argumentR- the type of function results- Parameters:
rateLimiter- the RateLimiterpermitsCalculator- calculates the number of permits required by this call based on the functions argumentfunction- 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 RateLimitersupplier- 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 RateLimiterpermits- number of permits that this call requiressupplier- 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 RateLimitersupplier- 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 RateLimiterpermits- number of permits that this call requiressupplier- 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 requiressupplier- 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 requiressupplier- 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 requirescheckedSupplier- the original Supplier- Returns:
- the result of the decorated Supplier.
- Throws:
Throwable- if something goes wrong applying this function to the given arguments
-