Class: DTR::Agent::Worker
Overview
Worker works during one dtr test task running. Worker manages Herald & Runner processes life cycle.
Instance Method Summary collapse
-
#initialize(runner_names, agent_env_setup_cmd) ⇒ Worker
constructor
A new instance of Worker.
- #launch ⇒ Object
Constructor Details
#initialize(runner_names, agent_env_setup_cmd) ⇒ Worker
Returns a new instance of Worker.
21 22 23 24 25 26 27 28 |
# File 'lib/dtr/agent/worker.rb', line 21 def initialize(runner_names, agent_env_setup_cmd) @runner_names = runner_names.is_a?(Array) ? runner_names : [runner_names.to_s] @agent_env_setup_cmd = agent_env_setup_cmd @runner_pids = [] @herald = nil @working_env_key = :working_env @env_store = EnvStore.new end |
Instance Method Details
#launch ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/dtr/agent/worker.rb', line 30 def launch DTR.info {"=> Agent worker started at: #{Dir.pwd}, pid: #{Process.pid}"} setup begin run ensure teardown DTR.info {"Agent worker is dieing"} end end |