Class RedissonRateLimiter
java.lang.Object
org.oxerr.rescu.ext.ratelimiter.redisson.RedissonRateLimiter
- All Implemented Interfaces:
org.oxerr.rescu.ext.ratelimiter.RateLimiter
public class RedissonRateLimiter
extends Object
implements org.oxerr.rescu.ext.ratelimiter.RateLimiter
-
Constructor Summary
ConstructorDescriptionRedissonRateLimiter
(org.redisson.api.RedissonClient redisson, String name) RedissonRateLimiter
(org.redisson.api.RRateLimiter rateLimiter) -
Method Summary
-
Constructor Details
-
RedissonRateLimiter
public RedissonRateLimiter(org.redisson.api.RRateLimiter rateLimiter) -
RedissonRateLimiter
-
-
Method Details
-
setRate
public void setRate(org.redisson.api.RateType mode, long rate, long rateInterval, org.redisson.api.RateIntervalUnit rateIntervalUnit) Updates RateLimiter's state and stores config to Redis server.- Parameters:
mode
- - rate moderate
- - raterateInterval
- - rate time intervalrateIntervalUnit
- - rate time interval unit
-
acquire
public void acquire()- Specified by:
acquire
in interfaceorg.oxerr.rescu.ext.ratelimiter.RateLimiter
-
getRateLimiter
public org.redisson.api.RRateLimiter getRateLimiter()
-