Sha256: 49cf928a11d0f32cb6bf0c3f738864806255e8edf7090e148a3d18ec490cd880

Contents?: true

Size: 371 Bytes

Versions: 1

Compression:

Stored size: 371 Bytes

Contents

require 'thread'

class Proco
module Queue
# @private
class MultiQueue < Proco::Queue::Base
  def initialize size
    super
    @future = Future.new
  end

  def push_impl item
    @items << item
    @future
  end

  def take_impl
    items   = @items
    ret     = [@future, items]

    # Reset vars
    @items  = []
    @future = Future.new

    ret
  end
end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
proco-0.0.1 lib/proco/queue/multi_queue.rb