Parent

Methods

Class/Module Index [+]

Quicksearch

OpenEndedQueue

Like Ruby's Queue class, but allowing both pushing and unshifting objects.

@api private

Public Instance Methods

unshift(obj) click to toggle source

@param [Object] obj @return [void]

# File lib/cinch/open_ended_queue.rb, line 10
def unshift(obj)
  t = nil
  @mutex.synchronize{
    @que.unshift obj
    begin
      t = @waiting.shift
      t.wakeup if t
    rescue ThreadError
      retry
    end
  }
  begin
    t.run if t
  rescue ThreadError
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.