Class: Dataflow::FutureQueue
- Includes:
- Dataflow
- Defined in:
- lib/vendor/dataflow/dataflow/future_queue.rb
Constant Summary
Constants included from Dataflow
Instance Method Summary collapse
-
#initialize ⇒ FutureQueue
constructor
A new instance of FutureQueue.
- #pop(x) ⇒ Object
- #push(x) ⇒ Object
Methods included from Dataflow
#barrier, #by_need, #flow, included, #local, #need_later, #unify
Constructor Details
#initialize ⇒ FutureQueue
Returns a new instance of FutureQueue.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/vendor/dataflow/dataflow/future_queue.rb', line 6 def initialize local do |pushed, popped| unify push_port, Dataflow::Port.new(pushed) unify pop_port, Dataflow::Port.new(popped) Thread.new { loop do pushed.head, popped.head unify popped.head, pushed.head pushed, popped = pushed.tail, popped.tail end } end end |