Class: Reqless::ClientWorkers
- Inherits:
-
Object
- Object
- Reqless::ClientWorkers
- 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
- #[](name) ⇒ Object
- #counts ⇒ Object
-
#initialize(client) ⇒ ClientWorkers
constructor
A new instance of ClientWorkers.
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 |
#counts ⇒ Object
105 106 107 |
# File 'lib/reqless.rb', line 105 def counts JSON.parse(@client.call('workers.counts')) end |