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.



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_successiveObject



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

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