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 Details

    • RedissonRateLimiter

      public RedissonRateLimiter(org.redisson.api.RRateLimiter rateLimiter)
    • RedissonRateLimiter

      public RedissonRateLimiter(org.redisson.api.RedissonClient redisson, String name)
  • 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 mode
      rate - - rate
      rateInterval - - rate time interval
      rateIntervalUnit - - rate time interval unit
    • acquire

      public void acquire()
      Specified by:
      acquire in interface org.oxerr.rescu.ext.ratelimiter.RateLimiter
    • getRateLimiter

      public org.redisson.api.RRateLimiter getRateLimiter()