Class: Proco::Queue::SingleQueue

Inherits:
Base
  • Object
show all
Defined in:
lib/proco/queue/single_queue.rb

Instance Method Summary collapse

Methods inherited from Base

#invalidate, #push, #take

Methods included from MT::Base

#broadcast, #do_when, #signal, #synchronize, #try_when, #wait_until

Constructor Details

#initialize(size, delay) ⇒ SingleQueue

Returns a new instance of SingleQueue.



7
8
9
# File 'lib/proco/queue/single_queue.rb', line 7

def initialize size, delay
  super
end

Instance Method Details

#push_impl(item) ⇒ Object



11
12
13
14
15
# File 'lib/proco/queue/single_queue.rb', line 11

def push_impl item
  future = Future.new
  @items << [future, item]
  future
end

#take_implObject



17
18
19
# File 'lib/proco/queue/single_queue.rb', line 17

def take_impl
  @items.shift
end