-
public class SimpleRateLimiterRate limiter that only supports non-blocking retrieval of a single token at a minimum rate of 1 per second. Tokens are not smoothed across the second.
-
-
Field Summary
Fields Modifier and Type Field Description private final intcapacity
-
Constructor Summary
Constructors Constructor Description SimpleRateLimiter(int rate)
-
Method Summary
Modifier and Type Method Description intgetCapacity()booleantryAcquire()-
-
Method Detail
-
getCapacity
int getCapacity()
-
tryAcquire
boolean tryAcquire()
-
-
-
-