Sha256: ec9362ffa89062201fe1429baf9a8dd44609eb6364b7215c728a9646402e311a
Contents?: true
Size: 389 Bytes
Versions: 1
Compression:
Stored size: 389 Bytes
Contents
# frozen_string_literal: true class Quickdraw::Queue def initialize @array = [] @mutex = Mutex.new end def <<(item) @mutex.synchronize { @array << item } end def drain yield(shift) until empty? end def pop @mutex.synchronize { @array.pop } end def shift @mutex.synchronize { @array.shift } end def empty? @array.empty? end def size @array.size end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
quickdraw-0.1.0 | lib/quickdraw/queue.rb |