public class BasicRateLimiter extends Object
| Constructor and Description |
|---|
BasicRateLimiter(double permitsPerSecond) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire(int permits)
Acquires the given number of permits from this
RateLimiter, blocking until the request
can be granted. |
double |
getRate() |
void |
setRate(double permitsPerSecond)
Updates the stable rate.
|
public BasicRateLimiter(double permitsPerSecond)
permitsPerSecond - Estimated number of permits per second.public void setRate(double permitsPerSecond)
permitsPerSecond - The new stable rate of this RateLimiter, set 0 for unlimited rate.IllegalArgumentException - If permitsPerSecond is negative or zero.public double getRate()
permits per seconds (0 means that the rate is unlimited).public void acquire(int permits)
throws IgniteInterruptedCheckedException
RateLimiter, blocking until the request
can be granted. Tells the amount of time slept, if any.permits - The number of permits to acquire.IllegalArgumentException - If the requested number of permits is negative or zero.IgniteInterruptedCheckedException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021