Class: Cosmos::ProcessManagerProcess
- Inherits:
-
OperatorProcess
- Object
- OperatorProcess
- Cosmos::ProcessManagerProcess
- Defined in:
- lib/cosmos/utilities/process_manager.rb
Instance Attribute Summary collapse
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#process_type ⇒ Object
Returns the value of attribute process_type.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from OperatorProcess
#env, #new_temp_dir, #process_definition, #scope, #temp_dir, #work_dir
Instance Method Summary collapse
-
#initialize(cmd_array, process_type, detail, expires_at, **kw_args) ⇒ ProcessManagerProcess
constructor
A new instance of ProcessManagerProcess.
- #start ⇒ Object
Methods inherited from OperatorProcess
#alive?, #exit_code, #extract_output, #hard_stop, setup, #soft_stop, #stderr, #stdout
Constructor Details
#initialize(cmd_array, process_type, detail, expires_at, **kw_args) ⇒ ProcessManagerProcess
Returns a new instance of ProcessManagerProcess.
33 34 35 36 37 38 39 |
# File 'lib/cosmos/utilities/process_manager.rb', line 33 def initialize(cmd_array, process_type, detail, expires_at, **kw_args) super(cmd_array, **kw_args) @process_type = process_type @detail = detail @expires_at = expires_at @status = nil end |
Instance Attribute Details
#detail ⇒ Object
Returns the value of attribute detail.
29 30 31 |
# File 'lib/cosmos/utilities/process_manager.rb', line 29 def detail @detail end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
30 31 32 |
# File 'lib/cosmos/utilities/process_manager.rb', line 30 def expires_at @expires_at end |
#process_type ⇒ Object
Returns the value of attribute process_type.
28 29 30 |
# File 'lib/cosmos/utilities/process_manager.rb', line 28 def process_type @process_type end |
#status ⇒ Object
Returns the value of attribute status.
31 32 33 |
# File 'lib/cosmos/utilities/process_manager.rb', line 31 def status @status end |
Instance Method Details
#start ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/cosmos/utilities/process_manager.rb', line 41 def start super() if @process @status = ProcessStatusModel.new(name: "#{Socket.gethostname}__#{@process.pid}", process_type: @process_type, detail: @detail, state: "Running", scope: @scope) @status.create end end |