module CableX::Cable::RateLimit::RateLimitRedis
Process Rate Limit
Public Instance Methods
block_device_key(schedule)
click to toggle source
# File lib/cable_x/cable/rate_limit/rate_limit_redis.rb, line 29 def block_device_key(schedule) "#{redis_config[:channel_prefix]}-rl-block-#{schedule}-#{device_id}" end
device_key(schedule)
click to toggle source
# File lib/cable_x/cable/rate_limit/rate_limit_redis.rb, line 25 def device_key(schedule) "#{redis_config[:channel_prefix]}-rl-#{schedule}-#{device_id}" end
redis_exists(key)
click to toggle source
# File lib/cable_x/cable/rate_limit/rate_limit_redis.rb, line 17 def redis_exists(key) redis.exists? key end
redis_get(key)
click to toggle source
# File lib/cable_x/cable/rate_limit/rate_limit_redis.rb, line 21 def redis_get(key) redis.get key end
redis_incr(key)
click to toggle source
# File lib/cable_x/cable/rate_limit/rate_limit_redis.rb, line 13 def redis_incr(key) redis.incr key end
redis_set(key, value, expire_millisecond)
click to toggle source
# File lib/cable_x/cable/rate_limit/rate_limit_redis.rb, line 9 def redis_set(key, value, expire_millisecond) redis.set key, value, px: expire_millisecond end