Method: Resque#peek

Defined in:
lib/resque.rb

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

Returns an array of items currently queued, or the item itself if count = 1. 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)


374
375
376
377
378
379
380
381
# File 'lib/resque.rb', line 374

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