Class: OpenC3::ProcessManagerProcess

Inherits:
OperatorProcess show all
Defined in:
lib/openc3/utilities/process_manager.rb

Instance Attribute Summary collapse

Attributes inherited from OperatorProcess

#env, #new_temp_dir, #process_definition, #scope, #temp_dir, #work_dir

Instance Method Summary collapse

Methods inherited from OperatorProcess

#alive?, #cmd_line, #exit_code, #extract_output, #hard_stop, #output_increment, setup, #soft_stop, #stderr, #stdout

Constructor Details

#initialize(cmd_array, process_type, detail, expires_at, **kw_args) ⇒ ProcessManagerProcess

Returns a new instance of ProcessManagerProcess.



37
38
39
40
41
42
43
# File 'lib/openc3/utilities/process_manager.rb', line 37

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

#detailObject

Returns the value of attribute detail.



32
33
34
# File 'lib/openc3/utilities/process_manager.rb', line 32

def detail
  @detail
end

#expires_atObject

Returns the value of attribute expires_at.



33
34
35
# File 'lib/openc3/utilities/process_manager.rb', line 33

def expires_at
  @expires_at
end

#nameObject

Returns the value of attribute name.



35
36
37
# File 'lib/openc3/utilities/process_manager.rb', line 35

def name
  @name
end

#process_typeObject

Returns the value of attribute process_type.



31
32
33
# File 'lib/openc3/utilities/process_manager.rb', line 31

def process_type
  @process_type
end

#statusObject

Returns the value of attribute status.



34
35
36
# File 'lib/openc3/utilities/process_manager.rb', line 34

def status
  @status
end

Instance Method Details

#startObject



45
46
47
48
49
50
51
# File 'lib/openc3/utilities/process_manager.rb', line 45

def start
  super()
  if @process
    @status = ProcessStatusModel.new(name: @name, process_type: @process_type, detail: @detail, state: "Running", scope: @scope)
    @status.create
  end
end