Hermes
Simulation Orchestration Platform for Aerospace
Loading...
Searching...
No Matches
hermes.core.process.ModuleProcess Class Reference

Public Member Functions

None __init__ (self, str name, ModuleConfig config, str shm_name, str barrier_name)
str name (self)
ModuleState state (self)
int|None pid (self)
bool is_alive (self)
None load (self)
None stage (self)
None mark_running (self)
None terminate (self, float timeout=5.0)
None kill (self)
ModuleInfo get_info (self)

Protected Member Functions

None _start_executable (self)
None _start_script (self)

Protected Attributes

str _name = name
 _config = config
 _shm_name = shm_name
 _barrier_name = barrier_name
subprocess.Popen[bytes]|None _process = None
 _state = ModuleState.INIT

Detailed Description

Manages a single module subprocess.

Handles the lifecycle of a module process including spawning,
communication via named pipes, and synchronization via semaphores.

Constructor & Destructor Documentation

◆ __init__()

None hermes.core.process.ModuleProcess.__init__ ( self,
str name,
ModuleConfig config,
str shm_name,
str barrier_name )
Initialize module process manager.

Args:
    name: Module name
    config: Module configuration
    shm_name: Shared memory segment name
    barrier_name: Frame barrier name

Member Function Documentation

◆ _start_executable()

None hermes.core.process.ModuleProcess._start_executable ( self)
protected
Start an external executable module.

◆ _start_script()

None hermes.core.process.ModuleProcess._start_script ( self)
protected
Start a Python script module.

◆ get_info()

ModuleInfo hermes.core.process.ModuleProcess.get_info ( self)
Get current module information.

◆ is_alive()

bool hermes.core.process.ModuleProcess.is_alive ( self)
Whether the process is still running.

◆ kill()

None hermes.core.process.ModuleProcess.kill ( self)
Forcefully kill the module process.

◆ load()

None hermes.core.process.ModuleProcess.load ( self)
Start the module process.

Raises:
    ModuleError: If process already started
    ModuleError: If executable not found
    ModuleConfigError: If module type is not supported

◆ mark_running()

None hermes.core.process.ModuleProcess.mark_running ( self)
Transition module to RUNNING state when execution begins.

◆ name()

str hermes.core.process.ModuleProcess.name ( self)
Module name.

◆ pid()

int | None hermes.core.process.ModuleProcess.pid ( self)
Process ID if running.

◆ stage()

None hermes.core.process.ModuleProcess.stage ( self)
Signal module to stage (prepare for execution).

The module should initialize, validate configuration, and
apply initial conditions.

◆ state()

ModuleState hermes.core.process.ModuleProcess.state ( self)
Current module state.

◆ terminate()

None hermes.core.process.ModuleProcess.terminate ( self,
float timeout = 5.0 )
Gracefully terminate the module.

Args:
    timeout: Seconds to wait before force killing

Member Data Documentation

◆ _barrier_name

hermes.core.process.ModuleProcess._barrier_name = barrier_name
protected

◆ _config

hermes.core.process.ModuleProcess._config = config
protected

◆ _name

hermes.core.process.ModuleProcess._name = name
protected

◆ _process

subprocess.Popen[bytes] | None hermes.core.process.ModuleProcess._process = None
protected

◆ _shm_name

hermes.core.process.ModuleProcess._shm_name = shm_name
protected

◆ _state

hermes.core.process.ModuleProcess._state = ModuleState.INIT
protected

The documentation for this class was generated from the following file: