Manages a pool of child processes. More...
#include <child_process_manager.hpp>
Public Member Functions | |
| ChildProcessManager ()=default | |
| ~ChildProcessManager () | |
| ConnectedChildProcess * | launch (std::string_view executable, const std::vector< std::string > &args={}) |
| Launch a child process and add it to the pool. | |
| int | active_count () const |
| Number of active child processes. | |
| void | kill_all () |
| Kill all child processes. | |
| void | wait_all (int timeout_ms=0) |
| Wait for all children to exit. | |
| void | cleanup () |
| Remove completed processes from the pool. | |
| ChildProcessManager (const ChildProcessManager &)=delete | |
| ChildProcessManager & | operator= (const ChildProcessManager &)=delete |
Public Attributes | |
| std::function< void(ConnectedChildProcess *, int exit_code)> | on_child_exit |
| Called when any child exits. | |
Manages a pool of child processes.
Useful for crash-isolated plugin scanning where each plugin is loaded in a separate process to prevent host crashes.
|
default |
| pulp::events::ChildProcessManager::~ChildProcessManager | ( | ) |
|
delete |
| int pulp::events::ChildProcessManager::active_count | ( | ) | const |
Number of active child processes.
| void pulp::events::ChildProcessManager::cleanup | ( | ) |
Remove completed processes from the pool.
| void pulp::events::ChildProcessManager::kill_all | ( | ) |
Kill all child processes.
| ConnectedChildProcess * pulp::events::ChildProcessManager::launch | ( | std::string_view | executable, |
| const std::vector< std::string > & | args = {} ) |
Launch a child process and add it to the pool.
Returns a pointer to the managed process (owned by the manager).
|
delete |
| void pulp::events::ChildProcessManager::wait_all | ( | int | timeout_ms = 0 | ) |
Wait for all children to exit.
| std::function<void(ConnectedChildProcess*, int exit_code)> pulp::events::ChildProcessManager::on_child_exit |
Called when any child exits.