A child process with a bidirectional IPC channel.
More...
#include <child_process_manager.hpp>
|
| std::function< void(std::string_view)> | on_message |
| | Called when a message is received from the child.
|
| std::function< void(int exit_code)> | on_exit |
| | Called when the child process exits.
|
A child process with a bidirectional IPC channel.
The child process connects back to the parent via a named pipe.
◆ ConnectedChildProcess() [1/2]
| pulp::events::ConnectedChildProcess::ConnectedChildProcess |
( |
| ) |
|
|
default |
◆ ~ConnectedChildProcess()
| pulp::events::ConnectedChildProcess::~ConnectedChildProcess |
( |
| ) |
|
◆ ConnectedChildProcess() [2/2]
| pulp::events::ConnectedChildProcess::ConnectedChildProcess |
( |
const ConnectedChildProcess & | | ) |
|
|
delete |
◆ connection()
The IPC connection (for advanced use).
◆ is_running()
| bool pulp::events::ConnectedChildProcess::is_running |
( |
| ) |
const |
|
inline |
Whether the child process is running.
◆ kill()
| void pulp::events::ConnectedChildProcess::kill |
( |
| ) |
|
◆ launch()
| bool pulp::events::ConnectedChildProcess::launch |
( |
std::string_view | executable, |
|
|
const std::vector< std::string > & | extra_args = {} ) |
Launch a child process with an IPC pipe.
The pipe name is passed to the child as a command-line argument.
◆ operator=()
◆ pid()
| int pulp::events::ConnectedChildProcess::pid |
( |
| ) |
const |
|
inline |
◆ send_message()
| bool pulp::events::ConnectedChildProcess::send_message |
( |
std::string_view | message | ) |
|
Send a message to the child.
◆ wait_for_exit()
| int pulp::events::ConnectedChildProcess::wait_for_exit |
( |
int | timeout_ms = 0 | ) |
|
Wait for the child to exit. Returns exit code.
◆ on_exit
| std::function<void(int exit_code)> pulp::events::ConnectedChildProcess::on_exit |
Called when the child process exits.
◆ on_message
| std::function<void(std::string_view)> pulp::events::ConnectedChildProcess::on_message |
Called when a message is received from the child.
The ConnectedChildProcess object must outlive this callback; destroying the object from inside the callback is unsupported.
The documentation for this class was generated from the following file: