Class: Vx::Worker::StartConnector
- Inherits:
-
Struct
- Object
- Struct
- Vx::Worker::StartConnector
- Includes:
- Helper::Config, Helper::Logger
- Defined in:
- lib/vx/worker/middlewares/start_connector.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Methods included from Helper::Logger
Methods included from Helper::Config
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
8 9 10 |
# File 'lib/vx/worker/middlewares/start_connector.rb', line 8 def app @app end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vx/worker/middlewares/start_connector.rb', line 13 def call(env) = config. .merge! logger: logger env.connector = ContainerConnector.lookup(config.run, ) env.connector.start do |spawner| env.job.add_to_output "using #{Socket.gethostname}##{spawner.id}\n" logger.tagged("#{spawner.id}") do begin env.spawner = spawner app.call env ensure env.spawner = spawner end end end end |