lib/pigeon/queue.rb
def peek(filter_name = nil, &block)
    if (block_given?)
      @filters.synchronize do
        @tasks.find(&block)
      end
    elsif (filter_name)
      @next_task[filter_name] ||= begin
        @filters.synchronize do
          filter_proc = @filters[filter_name]
      
          filter_proc and @tasks.find(&filter_proc)
        end
      end
    else
      @filters.synchronize do
        @tasks.first
      end
    end
  end
# Peeks at the next task in the queue, or if filter_name is provided,
# then the next task meeting those filter conditions. An optional block
# can also be used to further restrict the qualifying tasks.
Peeks at the next task in the queue, or if filter_name is provided,
then the next task meeting those filter conditions. An optional block
can also be used to further restrict the qualifying tasks.
Peeks at the next task in the queue or if filter_name is provided then the next task meeting those filter conditions . An optional block can also be used to further restrict the qualifying tasks .
def peek(filter_name = nil, &block)
    if (block_given?)
      @filters.synchronize do
        @tasks.find(&block)
      end
    elsif (filter_name)
      @next_task[filter_name] ||= begin
        @filters.synchronize do
          filter_proc = @filters[filter_name]
          filter_proc and @tasks.find(&filter_proc)
        end
      end
    else
      @filters.synchronize do
        @tasks.first
      end
    end
  end
def peek ( filter_name = nil , & block ) if ( block_given? ) @filters . synchronize do @tasks . find ( & block ) end elsif ( filter_name ) @next_task [ filter_name ] ||= begin @filters . synchronize do filter_proc = @filters [ filter_name ] filter_proc and @tasks . find ( & filter_proc ) end end else @filters . synchronize do @tasks . first end end end
Peeks at the next task in the queue, or if filter_name is provided,
then the next task meeting those filter conditions.
Peeks at the next task in the queue or if filter_name is provided then the next task meeting those filter conditions .
filter_name
block