Class: Bbq::Spawn::Orchestrator

Inherits:
Object
  • Object
show all
Defined in:
lib/bbq/spawn.rb

Instance Method Summary collapse

Constructor Details

#initializeOrchestrator

Returns a new instance of Orchestrator.



88
89
90
# File 'lib/bbq/spawn.rb', line 88

def initialize
  @executors = []
end

Instance Method Details

#coordinate(executor, options = {}) ⇒ Object



92
93
94
# File 'lib/bbq/spawn.rb', line 92

def coordinate(executor, options = {})
  @executors << CoordinatedExecutor.new(executor, options)
end

#startObject



96
97
98
99
# File 'lib/bbq/spawn.rb', line 96

def start
  @executors.each(&:start)
  @executors.each(&:join)
end

#stopObject



101
102
103
# File 'lib/bbq/spawn.rb', line 101

def stop
  @executors.each(&:stop)
end