Method: Resque#peek

Defined in:
lib/resque.rb

#peek(queue, start = 0, count = 1) ⇒ Object

Returns an array of items currently queued. Queue name should be a string.

start and count should be integer and can be used for pagination. start is the item to begin, count is how many items to return.

To get the 3rd page of a 30 item, paginatied list one would use:

Resque.peek('my_list', 59, 30)


295
296
297
298
299
300
301
302
# File 'lib/resque.rb', line 295

def peek(queue, start = 0, count = 1)
  results = data_store.peek_in_queue(queue,start,count)
  if count == 1
    decode(results)
  else
    results.map { |result| decode(result) }
  end
end