Class: Reqless::QueueJobs
- Inherits:
-
Object
- Object
- Reqless::QueueJobs
- Defined in:
- lib/reqless/queue.rb
Overview
A class for interacting with jobs in different states in a queue. Not meant to be instantiated directly, it’s accessed with Queue#jobs
Instance Method Summary collapse
- #depends(start = 0, count = 25) ⇒ Object
-
#initialize(name, client) ⇒ QueueJobs
constructor
A new instance of QueueJobs.
- #recurring(start = 0, count = 25) ⇒ Object
- #running(start = 0, count = 25) ⇒ Object
- #scheduled(start = 0, count = 25) ⇒ Object
- #stalled(start = 0, count = 25) ⇒ Object
- #throttled(start = 0, count = 25) ⇒ Object
Constructor Details
#initialize(name, client) ⇒ QueueJobs
Returns a new instance of QueueJobs.
11 12 13 14 |
# File 'lib/reqless/queue.rb', line 11 def initialize(name, client) @name = name @client = client end |
Instance Method Details
#depends(start = 0, count = 25) ⇒ Object
32 33 34 |
# File 'lib/reqless/queue.rb', line 32 def depends(start = 0, count = 25) JSON.parse(@client.call('queue.jobsByState', 'depends', @name, start, count)) end |
#recurring(start = 0, count = 25) ⇒ Object
36 37 38 |
# File 'lib/reqless/queue.rb', line 36 def recurring(start = 0, count = 25) JSON.parse(@client.call('queue.jobsByState', 'recurring', @name, start, count)) end |
#running(start = 0, count = 25) ⇒ Object
16 17 18 |
# File 'lib/reqless/queue.rb', line 16 def running(start = 0, count = 25) JSON.parse(@client.call('queue.jobsByState', 'running', @name, start, count)) end |
#scheduled(start = 0, count = 25) ⇒ Object
28 29 30 |
# File 'lib/reqless/queue.rb', line 28 def scheduled(start = 0, count = 25) JSON.parse(@client.call('queue.jobsByState', 'scheduled', @name, start, count)) end |
#stalled(start = 0, count = 25) ⇒ Object
24 25 26 |
# File 'lib/reqless/queue.rb', line 24 def stalled(start = 0, count = 25) JSON.parse(@client.call('queue.jobsByState', 'stalled', @name, start, count)) end |
#throttled(start = 0, count = 25) ⇒ Object
20 21 22 |
# File 'lib/reqless/queue.rb', line 20 def throttled(start = 0, count = 25) JSON.parse(@client.call('queue.jobsByState', 'throttled', @name, start, count)) end |