Class: Reqless::ClientThrottles

Inherits:
Object
  • Object
show all
Defined in:
lib/reqless.rb

Overview

A class for interacting with throttles. Not meant to be instantiated directly, it’s accessed through Client#throttles

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ClientThrottles

Returns a new instance of ClientThrottles.



133
134
135
# File 'lib/reqless.rb', line 133

def initialize(client)
  @client = client
end

Instance Method Details

#[](name) ⇒ Object



137
138
139
# File 'lib/reqless.rb', line 137

def [](name)
  Throttle.new(name, @client)
end

#countsObject



141
142
143
144
145
# File 'lib/reqless.rb', line 141

def counts
  @client.queues.counts.map do |queue|
    Queue.new(queue['name'], @client).throttle
  end
end