public abstract class RateLimiter extends Object
| Constructor and Description |
|---|
RateLimiter() |
| Modifier and Type | Method and Description |
|---|---|
void |
doWhenReady(@NotNull Runnable lambda)
Invoke a lambda function, with Thread.sleep() being called to limit the execution rate if needed.
|
<T> T |
getWhenReady(@NotNull Callable<T> lambda)
Invoke a lambda function and get the result, with Thread.sleep() being called to limit the execution rate
if needed.
|
public void doWhenReady(@NotNull
@NotNull Runnable lambda)
lambda - a Runnable lamda function to invokepublic <T> T getWhenReady(@NotNull
@NotNull Callable<T> lambda)
throws Exception
T - return type of the lamdalambda - a Callable lamda function to invokeException - rethrown from lambdaCopyright © 2019. All rights reserved.