Class: Processor::Thread

Inherits:
Object
  • Object
show all
Defined in:
lib/processor/thread.rb

Instance Method Summary collapse

Constructor Details

#initialize(data_processor, *observers) ⇒ Thread

Returns a new instance of Thread.



9
10
11
# File 'lib/processor/thread.rb', line 9

def initialize(data_processor, *observers)
  @runner = Runner.new EventProcessor.new(data_processor, observers)
end

Instance Method Details

#run_as(&process_runner) ⇒ Object



13
14
15
# File 'lib/processor/thread.rb', line 13

def run_as(&process_runner)
  runner.run process_runner
end

#run_in_threads(number_of_threads = 2) ⇒ Object



21
22
23
# File 'lib/processor/thread.rb', line 21

def run_in_threads(number_of_threads = 2)
  runner.run ProcessRunner::Threads.new number_of_threads
end

#run_successiveObject



17
18
19
# File 'lib/processor/thread.rb', line 17

def run_successive
  runner.run ProcessRunner::Successive.new
end