Class: Reqless::ClientWorkers

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ClientWorkers

Returns a new instance of ClientWorkers.



101
102
103
# File 'lib/reqless.rb', line 101

def initialize(client)
  @client = client
end

Instance Method Details

#[](name) ⇒ Object



109
110
111
# File 'lib/reqless.rb', line 109

def [](name)
  JSON.parse(@client.call('worker.jobs', name))
end

#countsObject



105
106
107
# File 'lib/reqless.rb', line 105

def counts
  JSON.parse(@client.call('workers.counts'))
end