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.
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, = {}) @executors << CoordinatedExecutor.new(executor, ) end |
#start ⇒ Object
96 97 98 99 |
# File 'lib/bbq/spawn.rb', line 96 def start @executors.each(&:start) @executors.each(&:join) end |
#stop ⇒ Object
101 102 103 |
# File 'lib/bbq/spawn.rb', line 101 def stop @executors.each(&:stop) end |