lib/pigeon/queue.rb
def sort_by(&block)
    raise BlockRequired unless (block_given?)

    @sort_by = block
    @filters.synchronize do
      @tasks = Pigeon::SortedArray.new(&@sort_by) + @tasks
      
      @next_task = { }
    end
  end
# Returns the contents sorted by the given block. The block will be passed
# a single Task and the results are sorted by the return value.
Returns the contents sorted by the given block. The block will be passed
a single Task and the results are sorted by the return value.
Returns the contents sorted by the given block . The block will be passed a single Task and the results are sorted by the return value .
def sort_by(&block)
    raise BlockRequired unless (block_given?)
    @sort_by = block
    @filters.synchronize do
      @tasks = Pigeon::SortedArray.new(&@sort_by) + @tasks
      @next_task = { }
    end
  end
def sort_by ( & block ) raise BlockRequired unless ( block_given? ) @sort_by = block @filters . synchronize do @tasks = Pigeon :: SortedArray . new ( & @sort_by ) + @tasks @next_task = { } end end
Returns the contents sorted by the given block.
Returns the contents sorted by the given block .
block