lib/simple_throttle.rb
# Add a global throttle that can be referenced later with the [] method.
Add a global throttle that can be referenced later with the [] method.
Add a global throttle that can be referenced later with the [] method .
def add(name, limit:, ttl:, redis: nil)
      @lock.synchronize do
        @throttles ||= {}
        @throttles[name.to_s] = new(name, limit: limit, ttl: ttl, redis: redis)
      end
    end
def add ( name , limit : , ttl : , redis : nil ) @lock . synchronize do @throttles ||= { } @throttles [ name . to_s ] = new ( name , limit : limit , ttl : ttl , redis : redis ) end end
Add a global throttle that can be referenced later with the [] method.
Add a global throttle that can be referenced later with the [] method .
name
<not_specific>
limit
<not_specific>
ttl
<not_specific>
redis
<not_specific>