Process Class Reference
|
Space-ng SDK
|
Manages the lifecycle of a single child process with restart capabilities. More...
#include <sol3/process_manager/process.h>
Public Member Functions | |
| void | asyncStart (bool reset_restart_count=false) |
| Asynchronously starts the process without resetting restart count. More... | |
| void | asyncRestart (bool reset_restart_count=false) |
| Asynchronously restarts the process without resetting restart count. More... | |
| void | asyncStop (std::optional< ExitHandler > on_exit={}) |
| Asynchronously stops the process and invokes a callback on exit. More... | |
| void | asyncSetLifecycleManagement (bool enabled) |
| Asynchronously sets lifecycle management (auto-restart, etc.). More... | |
| msg::ProcessTelemetryT | telemetry () const |
| Retrieves current process telemetry. More... | |
| msg::ProcessConfigT const & | config () const |
| Retrieves current process config. More... | |
Static Public Member Functions | |
| static std::shared_ptr< Process > | create (asio::Strand strand, msg::ProcessConfigT config, std::optional< ExitHandler > exit_handler={}, std::shared_ptr< IStdioContext > stdio_context={}) |
| Create a reference counted Process. More... | |
Detailed Description
Manages the lifecycle of a single child process with restart capabilities.
Process handles starting, stopping, restarting, and monitoring a child process. It supports automatic restarts on exit, lifecycle management control, and telemetry reporting. All operations are executed on a provided strand for thread safety.
Member Function Documentation
◆ asyncRestart()
| void sol3::process_manager::Process::asyncRestart | ( | bool | reset_restart_count = false | ) |
Asynchronously restarts the process without resetting restart count.
- Parameters
-
reset_restart_count Resets restart count.
◆ asyncSetLifecycleManagement()
| void sol3::process_manager::Process::asyncSetLifecycleManagement | ( | bool | enabled | ) |
Asynchronously sets lifecycle management (auto-restart, etc.).
- Parameters
-
enabled Whether lifecycle management is enabled or disabled.
◆ asyncStart()
| void sol3::process_manager::Process::asyncStart | ( | bool | reset_restart_count = false | ) |
Asynchronously starts the process without resetting restart count.
- Parameters
-
reset_restart_count Resets restart count if process is started.
◆ asyncStop()
| void sol3::process_manager::Process::asyncStop | ( | std::optional< ExitHandler > | on_exit = {} | ) |
Asynchronously stops the process and invokes a callback on exit.
- Parameters
-
on_exit Callback to invoke when the process exits (optional).
◆ config()
| msg::ProcessConfigT const& sol3::process_manager::Process::config | ( | ) | const |
Retrieves current process config.
- Returns
- Process config structure.
◆ create()
|
static |
◆ telemetry()
| msg::ProcessTelemetryT sol3::process_manager::Process::telemetry | ( | ) | const |
Retrieves current process telemetry.
- Returns
- Process telemetry structure.
- Note
- Must be called from the strand context.
The documentation for this class was generated from the following file:
- /workspaces/astro/sol3-sdk/cpp/sol3/process_manager/process.h
Generated by