public interface RateLimiter
A RateLimiter distributes permits at a configurable rate. acquirePermission() blocks if
necessary until a permit is available, and then takes it. Once acquired, permits need not be
released.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
RateLimiter.EventPublisher
An EventPublisher which can be used to register event consumers.
|
static interface |
RateLimiter.Metrics |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
acquirePermission()
Acquires a permission from this rate limiter, blocking until one is available, or the thread
is interrupted.
|
boolean |
acquirePermission(int permits)
Acquires the given number of permits from this rate limiter, blocking until one is available,
or the thread is interrupted.
|
void |
changeLimitForPeriod(int limitForPeriod)
Dynamic rate limiter configuration change.
|
void |
changeTimeoutDuration(java.time.Duration timeoutDuration)
Dynamic rate limiter configuration change.
|
static <T> java.util.concurrent.Callable<T> |
decorateCallable(RateLimiter rateLimiter,
java.util.concurrent.Callable<T> callable)
Creates a callable which is restricted by a RateLimiter.
|
static <T> java.util.concurrent.Callable<T> |
decorateCallable(RateLimiter rateLimiter,
int permits,
java.util.concurrent.Callable<T> callable)
Creates a callable which is restricted by a RateLimiter.
|
static <T,R> io.vavr.CheckedFunction1<T,R> |
decorateCheckedFunction(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(RateLimiter rateLimiter,
java.util.function.Function<T,java.lang.Integer> permitsCalculator,
io.vavr.CheckedFunction1<T,R> function)
Creates a function which is restricted by a RateLimiter.
|
static <T,R> io.vavr.CheckedFunction1<T,R> |
decorateCheckedFunction(RateLimiter rateLimiter,
int permits,
io.vavr.CheckedFunction1<T,R> function)
Creates a function which is restricted by a RateLimiter.
|
static io.vavr.CheckedRunnable |
decorateCheckedRunnable(RateLimiter rateLimiter,
io.vavr.CheckedRunnable runnable)
Creates a runnable which is restricted by a RateLimiter.
|
static io.vavr.CheckedRunnable |
decorateCheckedRunnable(RateLimiter rateLimiter,
int permits,
io.vavr.CheckedRunnable runnable)
Creates a runnable which is restricted by a RateLimiter.
|
static <T> io.vavr.CheckedFunction0<T> |
decorateCheckedSupplier(RateLimiter rateLimiter,
io.vavr.CheckedFunction0<T> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T> io.vavr.CheckedFunction0<T> |
decorateCheckedSupplier(RateLimiter rateLimiter,
int permits,
io.vavr.CheckedFunction0<T> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateCompletionStage(RateLimiter rateLimiter,
int permits,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
Returns a supplier which is decorated by a rateLimiter.
|
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateCompletionStage(RateLimiter rateLimiter,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
Returns a supplier which is decorated by a rateLimiter.
|
static <T> java.util.function.Consumer<T> |
decorateConsumer(RateLimiter rateLimiter,
java.util.function.Consumer<T> consumer)
Creates a consumer which is restricted by a RateLimiter.
|
static <T> java.util.function.Consumer<T> |
decorateConsumer(RateLimiter rateLimiter,
java.util.function.Function<T,java.lang.Integer> permitsCalculator,
java.util.function.Consumer<T> consumer)
Creates a consumer which is restricted by a RateLimiter.
|
static <T> java.util.function.Consumer<T> |
decorateConsumer(RateLimiter rateLimiter,
int permits,
java.util.function.Consumer<T> consumer)
Creates a consumer which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<io.vavr.control.Either<java.lang.Exception,T>> |
decorateEitherSupplier(RateLimiter rateLimiter,
int permits,
java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<io.vavr.control.Either<java.lang.Exception,T>> |
decorateEitherSupplier(RateLimiter rateLimiter,
java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T,R> java.util.function.Function<T,R> |
decorateFunction(RateLimiter rateLimiter,
java.util.function.Function<T,java.lang.Integer> permitsCalculator,
java.util.function.Function<T,R> function)
Creates a function which is restricted by a RateLimiter.
|
static <T,R> java.util.function.Function<T,R> |
decorateFunction(RateLimiter rateLimiter,
java.util.function.Function<T,R> function)
Creates a function which is restricted by a RateLimiter.
|
static <T,R> java.util.function.Function<T,R> |
decorateFunction(RateLimiter rateLimiter,
int permits,
java.util.function.Function<T,R> function)
Creates a function which is restricted by a RateLimiter.
|
static <T,F extends java.util.concurrent.Future<T>> |
decorateFuture(RateLimiter rateLimiter,
int permits,
java.util.function.Supplier<? extends F> supplier)
Returns a Supplier which is decorated by a RateLimiter.
|
static <T,F extends java.util.concurrent.Future<T>> |
decorateFuture(RateLimiter rateLimiter,
java.util.function.Supplier<? extends F> supplier)
Returns a Supplier which is decorated by a RateLimiter.
|
static java.lang.Runnable |
decorateRunnable(RateLimiter rateLimiter,
int permits,
java.lang.Runnable runnable)
Creates a runnable which is restricted by a RateLimiter.
|
static java.lang.Runnable |
decorateRunnable(RateLimiter rateLimiter,
java.lang.Runnable runnable)
Creates a runnable which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<T> |
decorateSupplier(RateLimiter rateLimiter,
int permits,
java.util.function.Supplier<T> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<T> |
decorateSupplier(RateLimiter rateLimiter,
java.util.function.Supplier<T> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<io.vavr.control.Try<T>> |
decorateTrySupplier(RateLimiter rateLimiter,
int permits,
java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
static <T> java.util.function.Supplier<io.vavr.control.Try<T>> |
decorateTrySupplier(RateLimiter rateLimiter,
java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
Creates a supplier which is restricted by a RateLimiter.
|
default <T> T |
executeCallable(java.util.concurrent.Callable<T> callable)
Decorates and executes the decorated Callable.
|
default <T> T |
executeCallable(int permits,
java.util.concurrent.Callable<T> callable)
Decorates and executes the decorated Callable.
|
default <T> T |
executeCheckedSupplier(io.vavr.CheckedFunction0<T> checkedSupplier)
Decorates and executes the decorated Supplier.
|
default <T> T |
executeCheckedSupplier(int permits,
io.vavr.CheckedFunction0<T> checkedSupplier)
Decorates and executes the decorated Supplier.
|
default <T> java.util.concurrent.CompletionStage<T> |
executeCompletionStage(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
Decorates and executes the decorated CompletionStage.
|
default <T> io.vavr.control.Either<java.lang.Exception,T> |
executeEitherSupplier(int permits,
java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
Decorates and executes the decorated Supplier.
|
default <T> io.vavr.control.Either<java.lang.Exception,T> |
executeEitherSupplier(java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
Decorates and executes the decorated Supplier.
|
default void |
executeRunnable(int permits,
java.lang.Runnable runnable)
Decorates and executes the decorated Runnable.
|
default void |
executeRunnable(java.lang.Runnable runnable)
Decorates and executes the decorated Runnable.
|
default <T> T |
executeSupplier(int permits,
java.util.function.Supplier<T> supplier)
Decorates and executes the decorated Supplier.
|
default <T> T |
executeSupplier(java.util.function.Supplier<T> supplier)
Decorates and executes the decorated Supplier.
|
default <T> io.vavr.control.Try<T> |
executeTrySupplier(int permits,
java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
Decorates and executes the decorated Supplier.
|
default <T> io.vavr.control.Try<T> |
executeTrySupplier(java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
Decorates and executes the decorated Supplier.
|
RateLimiter.EventPublisher |
getEventPublisher()
Returns an EventPublisher which can be used to register event consumers.
|
RateLimiter.Metrics |
getMetrics()
Get the Metrics of this RateLimiter.
|
java.lang.String |
getName()
Get the name of this RateLimiter
|
RateLimiterConfig |
getRateLimiterConfig()
Get the RateLimiterConfig of this RateLimiter.
|
io.vavr.collection.Map<java.lang.String,java.lang.String> |
getTags()
Returns an unmodifiable map with tags assigned to this RateLimiter.
|
static RateLimiter |
of(java.lang.String name,
RateLimiterConfig rateLimiterConfig)
Creates a RateLimiter with a custom RateLimiter configuration.
|
static RateLimiter |
of(java.lang.String name,
RateLimiterConfig rateLimiterConfig,
io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a RateLimiter with a custom RateLimiter configuration.
|
static RateLimiter |
of(java.lang.String name,
java.util.function.Supplier<RateLimiterConfig> rateLimiterConfigSupplier)
Creates a RateLimiter with a custom RateLimiterConfig configuration.
|
static RateLimiter |
of(java.lang.String name,
java.util.function.Supplier<RateLimiterConfig> rateLimiterConfigSupplier,
io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a RateLimiter with a custom RateLimiterConfig configuration.
|
static RateLimiter |
ofDefaults(java.lang.String name)
Creates a RateLimiter with a default RateLimiterConfig configuration.
|
default long |
reservePermission()
Reserves a permission from this rate limiter and returns nanoseconds you should wait for it.
|
long |
reservePermission(int permits)
Reserves the given number permits from this rate limiter and returns nanoseconds you should
wait for it.
|
static void |
waitForPermission(RateLimiter rateLimiter)
Will wait for permission within default timeout duration.
|
static void |
waitForPermission(RateLimiter rateLimiter,
int permits)
Will wait for required number of permits within default timeout duration.
|
static RateLimiter of(java.lang.String name, RateLimiterConfig rateLimiterConfig)
name - the name of the RateLimiterrateLimiterConfig - a custom RateLimiter configurationRateLimiterstatic RateLimiter of(java.lang.String name, RateLimiterConfig rateLimiterConfig, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
name - the name of the RateLimiterrateLimiterConfig - a custom RateLimiter configurationtags - tags to assign to the RateLimiterRateLimiterstatic RateLimiter of(java.lang.String name, java.util.function.Supplier<RateLimiterConfig> rateLimiterConfigSupplier)
name - the name of the RateLimiterrateLimiterConfigSupplier - a supplier of a custom RateLimiterConfig configurationRateLimiterstatic RateLimiter of(java.lang.String name, java.util.function.Supplier<RateLimiterConfig> rateLimiterConfigSupplier, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
name - the name of the RateLimiterrateLimiterConfigSupplier - a supplier of a custom RateLimiterConfig configurationtags - tags to assign to the RateLimiterRateLimiterstatic RateLimiter ofDefaults(java.lang.String name)
name - the name of the RateLimiterRateLimiterstatic <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCompletionStage(RateLimiter rateLimiter, java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
T - the type of the returned CompletionStage's resultrateLimiter - the rateLimitersupplier - the original supplierstatic <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCompletionStage(RateLimiter rateLimiter, int permits, java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
T - the type of the returned CompletionStage's resultrateLimiter - the rateLimiterpermits - number of permits that this call requiressupplier - the original supplierstatic <T,F extends java.util.concurrent.Future<T>> java.util.function.Supplier<F> decorateFuture(RateLimiter rateLimiter, java.util.function.Supplier<? extends F> supplier)
T - the type of the returned Future's resultF - the return type of the original Supplier (extends Future<T>)rateLimiter - the rate limitersupplier - the original supplierstatic <T,F extends java.util.concurrent.Future<T>> java.util.function.Supplier<F> decorateFuture(RateLimiter rateLimiter, int permits, java.util.function.Supplier<? extends F> supplier)
T - the type of the returned Future's resultF - the return type of the original Supplier (extends Future<T>)rateLimiter - the rate limiterpermits - the number of permits that this call requiressupplier - the original supplierstatic <T> io.vavr.CheckedFunction0<T> decorateCheckedSupplier(RateLimiter rateLimiter, io.vavr.CheckedFunction0<T> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimitersupplier - the original supplierstatic <T> io.vavr.CheckedFunction0<T> decorateCheckedSupplier(RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction0<T> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimiterpermits - number of permits that this call requiressupplier - the original supplierstatic io.vavr.CheckedRunnable decorateCheckedRunnable(RateLimiter rateLimiter, io.vavr.CheckedRunnable runnable)
rateLimiter - the RateLimiterrunnable - the original runnablestatic io.vavr.CheckedRunnable decorateCheckedRunnable(RateLimiter rateLimiter, int permits, io.vavr.CheckedRunnable runnable)
rateLimiter - the RateLimiterpermits - number of permits that this call requiresrunnable - the original runnablestatic <T,R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(RateLimiter rateLimiter, io.vavr.CheckedFunction1<T,R> function)
T - the type of function argumentR - the type of function resultsrateLimiter - the RateLimiterfunction - the original functionstatic <T,R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(RateLimiter rateLimiter, int permits, io.vavr.CheckedFunction1<T,R> function)
T - the type of function argumentR - the type of function resultsrateLimiter - the RateLimiterpermits - number of permits that this call requiresfunction - the original functionstatic <T,R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(RateLimiter rateLimiter, java.util.function.Function<T,java.lang.Integer> permitsCalculator, io.vavr.CheckedFunction1<T,R> function)
T - the type of function argumentR - the type of function resultsrateLimiter - the RateLimiterpermitsCalculator - calculates the number of permits required by this call based on the
functions argumentfunction - the original functionstatic <T> java.util.function.Supplier<T> decorateSupplier(RateLimiter rateLimiter, java.util.function.Supplier<T> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimitersupplier - the original supplierstatic <T> java.util.function.Supplier<T> decorateSupplier(RateLimiter rateLimiter, int permits, java.util.function.Supplier<T> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimiterpermits - number of permits that this call requiressupplier - the original supplierstatic <T> java.util.function.Supplier<io.vavr.control.Try<T>> decorateTrySupplier(RateLimiter rateLimiter, java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimitersupplier - the original supplierstatic <T> java.util.function.Supplier<io.vavr.control.Try<T>> decorateTrySupplier(RateLimiter rateLimiter, int permits, java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimiterpermits - number of permits that this call requiressupplier - the original supplierstatic <T> java.util.function.Supplier<io.vavr.control.Either<java.lang.Exception,T>> decorateEitherSupplier(RateLimiter rateLimiter, java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimitersupplier - the original supplierstatic <T> java.util.function.Supplier<io.vavr.control.Either<java.lang.Exception,T>> decorateEitherSupplier(RateLimiter rateLimiter, int permits, java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
T - the type of results supplied supplierrateLimiter - the RateLimiterpermits - number of permits that this call requiressupplier - the original supplierstatic <T> java.util.concurrent.Callable<T> decorateCallable(RateLimiter rateLimiter, java.util.concurrent.Callable<T> callable)
T - the type of results supplied by callablerateLimiter - the RateLimitercallable - the original callablestatic <T> java.util.concurrent.Callable<T> decorateCallable(RateLimiter rateLimiter, int permits, java.util.concurrent.Callable<T> callable)
T - the type of results supplied by callablerateLimiter - the RateLimiterpermits - number of permits that this call requirescallable - the original callablestatic <T> java.util.function.Consumer<T> decorateConsumer(RateLimiter rateLimiter, java.util.function.Consumer<T> consumer)
T - the type of the input to the consumerrateLimiter - the RateLimiterconsumer - the original consumerstatic <T> java.util.function.Consumer<T> decorateConsumer(RateLimiter rateLimiter, int permits, java.util.function.Consumer<T> consumer)
T - the type of the input to the consumerrateLimiter - the RateLimiterpermits - number of permits that this call requiresconsumer - the original consumerstatic <T> java.util.function.Consumer<T> decorateConsumer(RateLimiter rateLimiter, java.util.function.Function<T,java.lang.Integer> permitsCalculator, java.util.function.Consumer<T> consumer)
T - the type of the input to the consumerrateLimiter - the RateLimiterpermitsCalculator - calculates the number of permits required by this call based on the
functions argumentconsumer - the original consumerstatic java.lang.Runnable decorateRunnable(RateLimiter rateLimiter, java.lang.Runnable runnable)
rateLimiter - the RateLimiterrunnable - the original runnablestatic java.lang.Runnable decorateRunnable(RateLimiter rateLimiter, int permits, java.lang.Runnable runnable)
rateLimiter - the RateLimiterpermits - number of permits that this call requiresrunnable - the original runnablestatic <T,R> java.util.function.Function<T,R> decorateFunction(RateLimiter rateLimiter, java.util.function.Function<T,R> function)
T - the type of the input to the functionR - the type of the result of the functionrateLimiter - the RateLimiterfunction - the original functionstatic <T,R> java.util.function.Function<T,R> decorateFunction(RateLimiter rateLimiter, int permits, java.util.function.Function<T,R> function)
T - the type of the input to the functionR - the type of the result of the functionrateLimiter - the RateLimiterpermits - number of permits that this call requiresfunction - the original functionstatic <T,R> java.util.function.Function<T,R> decorateFunction(RateLimiter rateLimiter, java.util.function.Function<T,java.lang.Integer> permitsCalculator, java.util.function.Function<T,R> function)
T - the type of the input to the functionR - the type of the result of the functionrateLimiter - the RateLimiterfunction - the original functionpermitsCalculator - calculates the number of permits required by this call based on the
functions argumentstatic void waitForPermission(RateLimiter rateLimiter)
rateLimiter - the RateLimiter to get permission fromRequestNotPermitted - if waiting time elapsed before a permit was
acquired.io.github.resilience4j.core.exception.AcquirePermissionCancelledException - if thread was interrupted during permission waitstatic void waitForPermission(RateLimiter rateLimiter, int permits)
rateLimiter - the RateLimiter to get permission frompermits - number of permits we have to acquireRequestNotPermitted - if waiting time elapsed before a permit was
acquired.io.github.resilience4j.core.exception.AcquirePermissionCancelledException - if thread was interrupted during permission waitdefault <T> java.util.concurrent.CompletionStage<T> executeCompletionStage(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> supplier)
T - the type of results supplied by this suppliersupplier - the original CompletionStagevoid changeTimeoutDuration(java.time.Duration timeoutDuration)
timeoutDuration - new timeout durationvoid changeLimitForPeriod(int limitForPeriod)
limitForPeriod - new permissions limitdefault boolean acquirePermission()
RateLimiterConfig.getTimeoutDuration()
If the current thread is interrupted while waiting for a permit then it won't throw InterruptedException, but its interrupt status will be set.
true if a permit was acquired and false if waiting timeoutDuration
elapsed before a permit was acquiredboolean acquirePermission(int permits)
RateLimiterConfig.getTimeoutDuration()
If the current thread is interrupted while waiting for a permit then it won't throw InterruptedException, but its interrupt status will be set.
permits - number of permits - use for systems where 1 call != 1 permittrue if a permit was acquired and false if waiting timeoutDuration
elapsed before a permit was acquireddefault long reservePermission()
RateLimiterConfig.getTimeoutDuration() is less then time to wait for permission.long amount of nanoseconds you should wait for reserved permissions. if
negative, it means you failed to reserve.long reservePermission(int permits)
RateLimiterConfig.getTimeoutDuration() is less then time to wait for
permission.permits - number of permits - use for systems where 1 call != 1 permitlong amount of nanoseconds you should wait for reserved permissions. if
negative, it means you failed to reserve.java.lang.String getName()
RateLimiterConfig getRateLimiterConfig()
io.vavr.collection.Map<java.lang.String,java.lang.String> getTags()
RateLimiter.Metrics getMetrics()
RateLimiter.EventPublisher getEventPublisher()
default <T> T executeSupplier(java.util.function.Supplier<T> supplier)
T - the type of results supplied by this suppliersupplier - the original Supplierdefault <T> T executeSupplier(int permits,
java.util.function.Supplier<T> supplier)
T - the type of results supplied by this supplierpermits - number of permits that this call requiressupplier - the original Supplierdefault <T> io.vavr.control.Try<T> executeTrySupplier(java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
T - the type of results supplied by this suppliersupplier - the original Supplierdefault <T> io.vavr.control.Try<T> executeTrySupplier(int permits,
java.util.function.Supplier<io.vavr.control.Try<T>> supplier)
T - the type of results supplied by this supplierpermits - number of permits that this call requiressupplier - the original Supplierdefault <T> io.vavr.control.Either<java.lang.Exception,T> executeEitherSupplier(java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
T - the type of results supplied by this suppliersupplier - the original Supplierdefault <T> io.vavr.control.Either<java.lang.Exception,T> executeEitherSupplier(int permits,
java.util.function.Supplier<io.vavr.control.Either<? extends java.lang.Exception,T>> supplier)
T - the type of results supplied by this supplierpermits - number of permits that this call requiressupplier - the original Supplierdefault <T> T executeCallable(java.util.concurrent.Callable<T> callable)
throws java.lang.Exception
T - the result type of callablecallable - the original Callablejava.lang.Exception - if unable to compute a resultdefault <T> T executeCallable(int permits,
java.util.concurrent.Callable<T> callable)
throws java.lang.Exception
T - the result type of callablepermits - number of permits that this call requirescallable - the original Callablejava.lang.Exception - if unable to compute a resultdefault void executeRunnable(java.lang.Runnable runnable)
runnable - the original Runnabledefault void executeRunnable(int permits,
java.lang.Runnable runnable)
permits - number of permits that this call requiresrunnable - the original Runnabledefault <T> T executeCheckedSupplier(io.vavr.CheckedFunction0<T> checkedSupplier)
throws java.lang.Throwable
T - the type of results supplied by this suppliercheckedSupplier - the original Supplierjava.lang.Throwable - if something goes wrong applying this function to the given argumentsdefault <T> T executeCheckedSupplier(int permits,
io.vavr.CheckedFunction0<T> checkedSupplier)
throws java.lang.Throwable
T - the type of results supplied by this supplierpermits - number of permits that this call requirescheckedSupplier - the original Supplierjava.lang.Throwable - if something goes wrong applying this function to the given arguments