lib/redis_locks/token_bucket.rb
def take
      took = @redis.with do |conn|
        RedisLocks.evalsha_or_eval(
          conn: conn,
          script: SCRIPT,
          digest: DIGEST,
          keys: [@key],
          args: [epoch_f(conn), @rps, @burst]
        )
      end

      took == 1
    end
def take
      took = @redis.with do |conn|
        RedisLocks.evalsha_or_eval(
          conn: conn,
          script: SCRIPT,
          digest: DIGEST,
          keys: [@key],
          args: [epoch_f(conn), @rps, @burst]
        )
      end

      took == 1
    end
`number` tokens are added to the bucket every `period` seconds (up to a
 max of `number` tokens being available). Each time a resource is used, a
 token is removed from the bucket; if no tokens are available, no resource
 may be used.