Class: Bbq::Spawn::Orchestrator
- Inherits:
-
Object
- Object
- Bbq::Spawn::Orchestrator
- Defined in:
- lib/bbq/spawn.rb
Instance Method Summary collapse
- #coordinate(executor, options = {}) ⇒ Object
-
#initialize ⇒ Orchestrator
constructor
A new instance of Orchestrator.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Orchestrator
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, = {}) @executors << CoordinatedExecutor.new(executor, ) end |
#start ⇒ Object
102 103 104 105 |
# File 'lib/bbq/spawn.rb', line 102 def start @executors.each(&:start) @executors.each(&:join) end |
#stop ⇒ Object
107 108 109 |
# File 'lib/bbq/spawn.rb', line 107 def stop @executors.each(&:stop) end |