public class BasicRateLimiter extends Object
| Constructor and Description |
|---|
BasicRateLimiter(double permitsPerSecond) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire(long permits)
Acquires the given number of permits from this
RateLimiter, blocking until the request
can be granted. |
double |
getRate() |
boolean |
isUnlimited() |
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 boolean isUnlimited()
True if the rate is not limited.public void acquire(long 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.15.0 Release Date : April 25 2023