Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::events::ChildProcessManager Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ ChildProcessManager() [1/2]

pulp::events::ChildProcessManager::ChildProcessManager ( )
default

◆ ~ChildProcessManager()

pulp::events::ChildProcessManager::~ChildProcessManager ( )

◆ ChildProcessManager() [2/2]

pulp::events::ChildProcessManager::ChildProcessManager ( const ChildProcessManager & )
delete

Member Function Documentation

◆ active_count()

int pulp::events::ChildProcessManager::active_count ( ) const

Number of active child processes.

◆ cleanup()

void pulp::events::ChildProcessManager::cleanup ( )

Remove completed processes from the pool.

◆ kill_all()

void pulp::events::ChildProcessManager::kill_all ( )

Kill all child processes.

◆ launch()

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).

◆ operator=()

ChildProcessManager & pulp::events::ChildProcessManager::operator= ( const ChildProcessManager & )
delete

◆ wait_all()

void pulp::events::ChildProcessManager::wait_all ( int timeout_ms = 0)

Wait for all children to exit.

Member Data Documentation

◆ on_child_exit

std::function<void(ConnectedChildProcess*, int exit_code)> pulp::events::ChildProcessManager::on_child_exit

Called when any child exits.


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