Sha256: 5655fc3536312312977a6230f6260a3b7e60f132b1794032fe1cd22ac11d225a

Contents?: true

Size: 299 Bytes

Versions: 5

Compression:

Stored size: 299 Bytes

Contents

module Sideband
  class Queue

    def initialize
      @queue = ::Queue.new
    end

    def kill
      @queue << nil
    end

    def push(work)
      return false if work.nil?
      @queue.push(work)
      true
    end
    alias_method :<<, :push

    def pop
      @queue.pop
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sideband-1.0.4 lib/sideband/queue.rb
sideband-1.0.3 lib/sideband/queue.rb
sideband-1.0.2 lib/sideband/queue.rb
sideband-1.0.1 lib/sideband/queue.rb
sideband-1.0.0 lib/sideband/queue.rb