Class: RbEAI::RouterPipeTask
- Defined in:
- lib/rbeai/PipeTask.rb,
lib/rbeai/RouterPipeTask.rb
Instance Method Summary collapse
-
#initialize(inputQueue, task, control) ⇒ RouterPipeTask
constructor
A new instance of RouterPipeTask.
- #run(numItems = 1) ⇒ Object
- #waitToEnd ⇒ Object
Methods inherited from PipeTask
Constructor Details
#initialize(inputQueue, task, control) ⇒ RouterPipeTask
Returns a new instance of RouterPipeTask.
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/rbeai/PipeTask.rb', line 135 def initialize(inputQueue, task, control) @inputQueue = inputQueue @task = task @control = control @resultQueue = task.initQueues() @bufferQueue = nil @nextPipe = _getNextPipes() @size = task.size @threadPool = ThreadPool.new(@size, @task, @task.method(:doJob), inputQueue, @resultQueue, @bufferQueue, control.controlQueue) end |
Instance Method Details
#run(numItems = 1) ⇒ Object
146 147 148 149 150 |
# File 'lib/rbeai/PipeTask.rb', line 146 def run() _RunNextPipes() @threadPool.start(@task.name) @control.start(@threadPool) end |
#waitToEnd ⇒ Object
152 153 154 155 156 157 |
# File 'lib/rbeai/PipeTask.rb', line 152 def waitToEnd() #print "JOIN-#{@task.name}\n" @control.waitJoin print "END-#{@task.name}\n" _WaitToEndNextPipes() end |