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.
7 8 9 |
# File 'lib/processor/thread.rb', line 7 def initialize(data_processor, *observers) @runner = Runner.new data_processor, EventsRegistrator.new(observers) end |
Instance Method Details
#run_as(&process_runner) ⇒ Object
11 12 13 |
# File 'lib/processor/thread.rb', line 11 def run_as(&process_runner) runner.run process_runner end |
#run_in_threads(number_of_threads = 2) ⇒ Object
19 20 21 |
# File 'lib/processor/thread.rb', line 19 def run_in_threads(number_of_threads = 2) runner.run ProcessRunner::Threads.new number_of_threads end |
#run_successive ⇒ Object
15 16 17 |
# File 'lib/processor/thread.rb', line 15 def run_successive runner.run ProcessRunner::Successive.new end |