Class: Processor::Thread
- Inherits:
-
Object
- Object
- Processor::Thread
- Defined in:
- lib/processor/thread.rb
Instance Method Summary collapse
-
#initialize(data_processor, *observers) ⇒ Thread
constructor
A new instance of Thread.
- #run_as(&process_runner) ⇒ Object
- #run_in_threads(number_of_threads = 2) ⇒ Object
- #run_successive ⇒ Object
Constructor Details
#initialize(data_processor, *observers) ⇒ Thread
Returns a new instance of Thread.
8 9 10 |
# File 'lib/processor/thread.rb', line 8 def initialize(data_processor, *observers) @runner = Runner.new EventProcessor.new(data_processor, observers) end |
Instance Method Details
#run_as(&process_runner) ⇒ Object
12 13 14 |
# File 'lib/processor/thread.rb', line 12 def run_as(&process_runner) runner.run process_runner end |
#run_in_threads(number_of_threads = 2) ⇒ Object
20 21 22 |
# File 'lib/processor/thread.rb', line 20 def run_in_threads(number_of_threads = 2) runner.run ProcessRunner::Threads.new number_of_threads end |
#run_successive ⇒ Object
16 17 18 |
# File 'lib/processor/thread.rb', line 16 def run_successive runner.run ProcessRunner::Successive.new end |