/workspaces/astro/sol3-sdk/cpp/sol3/process_manager/process.h Source File
|
Space-ng SDK
|
process.h
Go to the documentation of this file.
Definition: process.h:68
virtual bpv2::process_stdio getProcessStdio()=0
virtual ~IStdioContext()=default
Manages the lifecycle of a single child process with restart capabilities.
Definition: process.h:81
void asyncStart(bool reset_restart_count=false)
Asynchronously starts the process without resetting restart count.
void asyncSetLifecycleManagement(bool enabled)
Asynchronously sets lifecycle management (auto-restart, etc.).
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.
void asyncRestart(bool reset_restart_count=false)
Asynchronously restarts the process without resetting restart count.
void asyncStop(std::optional< ExitHandler > on_exit={})
Asynchronously stops the process and invokes a callback on exit.
msg::ProcessConfigT const & config() const
Retrieves current process config.
msg::ProcessTelemetryT telemetry() const
Retrieves current process telemetry.
boost::asio::strand< boost::asio::io_context::executor_type > Strand
Definition: strand.h:8
Definition: process.h:20
std::function< void(std::shared_ptr< Process > process)> ExitHandler
Callback invoked when a process exits.
Definition: process.h:28
ProcessInvocationState
Current process lifecycle state.
Definition: process.h:31
@ running
Process has been started, and hasn't been stopped or reaped.
@ failed_to_start
Process failed to ever start.
Represents a single invocation (execution) of a process.
Definition: process.h:45
boost::process::v2::process child
The boost::process child handle.
Definition: process.h:47
bool auto_restart_disabled
True if auto restart was disabled for this process invocation.
Definition: process.h:65
std::optional< core::msg::Stamp > stopped
Timestamp when this invocation was stopped.
Definition: process.h:55
std::vector< ExitHandler > exit_handlers
Handlers to invoke when this process invocation exits.
Definition: process.h:49
ProcessInvocationState state
Process state.
Definition: process.h:53
core::msg::Stamp started
Timestamp when this invocation was started.
Definition: process.h:51
Generated by