Class: Async::Runner::Controller
- Inherits:
-
Container::Controller
- Object
- Container::Controller
- Async::Runner::Controller
- Defined in:
- lib/async/runner/controller.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create_container ⇒ Object
- #create_job ⇒ Object
-
#initialize(command) ⇒ Controller
constructor
A new instance of Controller.
- #setup(container) ⇒ Object
Constructor Details
#initialize(command) ⇒ Controller
Returns a new instance of Controller.
8 9 10 11 |
# File 'lib/async/runner/controller.rb', line 8 def initialize(command) @command = command super() end |
Class Method Details
.run(command) ⇒ Object
4 5 6 |
# File 'lib/async/runner/controller.rb', line 4 def self.run(command) new(command).run end |
Instance Method Details
#create_container ⇒ Object
13 14 15 |
# File 'lib/async/runner/controller.rb', line 13 def create_container @command.container_class.new end |
#create_job ⇒ Object
17 18 19 |
# File 'lib/async/runner/controller.rb', line 17 def create_job @command.job_class.new(@command.file, **@command.) end |
#setup(container) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/async/runner/controller.rb', line 21 def setup(container) @job = create_job @job.setup container.run name: @command.file, **@command. do |instance| instance.ready! Sync do @job.execute end end end |