|
UniSet 2.44.3
|
#include <ProcessManager.h>
Открытые типы | |
| using | ProcessCallback = std::function<void(const ProcessInfo&)> |
Открытые члены | |
| ProcessManager (std::shared_ptr< Configuration > conf=nullptr) | |
| void | setNodeName (const std::string &name) |
| std::string | getNodeName () const |
| void | setHealthCheckInterval (size_t msec) |
| void | setRestartWindow (size_t msec) |
| void | setStopTimeout (size_t msec) |
| void | setCommonArgs (const std::vector< std::string > &args) |
| void | setPassthroughArgs (const std::string &args) |
| void | setForwardArgs (const std::vector< std::string > &args) |
| void | addProcess (const ProcessInfo &proc) |
| void | addGroup (const ProcessGroup &group) |
| bool | startAll () |
| void | stopAll () |
| void | restartAll () |
| Restart all running processes. | |
| void | reloadAll () |
| Stop all, then start all (except skip, manual). | |
| bool | restartProcess (const std::string &name) |
| bool | stopProcess (const std::string &name) |
| bool | startProcess (const std::string &name) |
| void | startMonitoring () |
| void | stopMonitoring () |
| bool | isMonitoring () const |
| ProcessState | getProcessState (const std::string &name) const |
| ProcessInfo | getProcessInfo (const std::string &name) const |
| std::vector< ProcessInfo > | getAllProcesses () const |
| std::vector< ProcessGroup > | getAllGroups () const |
| bool | allRunning () const |
| bool | anyCriticalFailed () const |
| std::vector< std::string > | getFullArgs (const std::string &name) const |
| Get full arguments list for a process (commonArgs + args + forwardArgs). | |
| void | printRunList (std::ostream &out) const |
| void | setOnProcessStarted (ProcessCallback cb) |
| void | setOnProcessStopped (ProcessCallback cb) |
| void | setOnProcessFailed (ProcessCallback cb) |
| std::shared_ptr< DebugStream > | log () |
Process Manager - manages process lifecycle. Handles startup order, health monitoring, and automatic restarts.
Process Tree Termination: When stopping a process, the manager terminates the entire process tree (the process and all its descendants). This ensures no orphaned child processes remain after stop. The termination algorithm:
| std::vector< std::string > uniset::ProcessManager::getFullArgs | ( | const std::string & | name | ) | const |
Get full arguments list for a process (commonArgs + args + forwardArgs).
| void uniset::ProcessManager::printRunList | ( | std::ostream & | out | ) | const |
Print run list (dry-run mode). Shows what will be launched, with what parameters, in what order.
| out | Output stream (e.g. std::cout) |
| void uniset::ProcessManager::reloadAll | ( | ) |
Stop all, then start all (except skip, manual).
| void uniset::ProcessManager::restartAll | ( | ) |
Restart all running processes.