Method: Qless::Queue#peek
- Defined in:
- lib/qless/queue.rb
#peek(count = nil) ⇒ Object
Peek at a work item
150 151 152 153 154 |
# File 'lib/qless/queue.rb', line 150 def peek(count = nil) jids = JSON.parse(@client.call('peek', @name, (count || 1))) jobs = jids.map { |j| Job.new(@client, j) } count.nil? ? jobs[0] : jobs end |