lib/pigeon/queue.rb
def pull(filter_name = nil, &block)
    if (!block_given? and filter_name)
      block = @filters[filter_name]
    end
    
    @filters.synchronize do
      tasks = block ? @tasks.select(&block) : @tasks

      @tasks -= tasks
      
      @next_task.keys.each do |_filter_name|
        if (tasks.include?(@next_task[_filter_name]))
          @next_task[_filter_name] = nil
        end
      end
      
      tasks
    end
  end
# Removes all tasks from the queue. If a filter_name is given, then will
# only remove tasks matching that filter's conditions. An optional block
# can also be used to further restrict the qualifying tasks.
Removes all tasks from the queue. If a filter_name is given, then will
only remove tasks matching that filter's conditions. An optional block
can also be used to further restrict the qualifying tasks.
Removes all tasks from the queue . If a filter_name is given then will only remove tasks matching that filter ' s conditions . An optional block can also be used to further restrict the qualifying tasks .
def pull(filter_name = nil, &block)
    if (!block_given? and filter_name)
      block = @filters[filter_name]
    end
    @filters.synchronize do
      tasks = block ? @tasks.select(&block) : @tasks
      @tasks -= tasks
      @next_task.keys.each do |_filter_name|
        if (tasks.include?(@next_task[_filter_name]))
          @next_task[_filter_name] = nil
        end
      end
      tasks
    end
  end
def pull ( filter_name = nil , & block ) if ( ! block_given? and filter_name ) block = @filters [ filter_name ] end @filters . synchronize do tasks = block ? @tasks . select ( & block ) : @tasks @tasks -= tasks @next_task . keys . each do | _filter_name | if ( tasks . include? ( @next_task [ _filter_name ] ) ) @next_task [ _filter_name ] = nil end end tasks end end
Removes all tasks from the queue.
Removes all tasks from the queue .
filter_name
block