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.



94
95
96
# File 'lib/bbq/spawn.rb', line 94

def initialize
  @executors = []
end

Instance Method Details

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



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

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

#startObject



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

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

#stopObject



107
108
109
# File 'lib/bbq/spawn.rb', line 107

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