userver: engine::subprocess::ChildProcess Class Reference
Loading...
Searching...
No Matches
engine::subprocess::ChildProcess Class Referencefinal

#include <userver/engine/subprocess/child_process.hpp>

Detailed Description

Class that allows controlling child process; usually retrieved from engine::subprocess::ProcessStarter.

Definition at line 21 of file child_process.hpp.

Public Member Functions

 ChildProcess (ChildProcess &&) noexcept
 
ChildProcessoperator= (ChildProcess &&) noexcept
 
 ~ChildProcess ()
 Does not terminate the child process (just detaches from it).
 
int GetPid () const
 Returns pid of the child process.
 
void Wait ()
 Wait for the child process to terminate. Ignores cancellations of the current task.
 
template<typename Rep , typename Period >
bool WaitFor (std::chrono::duration< Rep, Period > duration)
 Wait for the child process to terminate.
 
template<typename Clock , typename Duration >
bool WaitUntil (std::chrono::time_point< Clock, Duration > until)
 Wait for the child process to terminate.
 
bool WaitUntil (Deadline deadline)
 
ChildProcessStatus Get ()
 Wait for the child process to terminate, ignoring cancellations.
 
void SendSignal (int signum)
 Send a signal to the child process.
 

Member Function Documentation

◆ Get()

ChildProcessStatus engine::subprocess::ChildProcess::Get ( )

Wait for the child process to terminate, ignoring cancellations.

Returns
ChildProcessStatus of finished subprocess

◆ WaitFor()

template<typename Rep , typename Period >
bool engine::subprocess::ChildProcess::WaitFor ( std::chrono::duration< Rep, Period >  duration)
inline

Wait for the child process to terminate.

Returns
false if this did not happen for the specified timeout duration or a task cancellation happened; true otherwise.

Definition at line 44 of file child_process.hpp.

◆ WaitUntil() [1/2]

bool engine::subprocess::ChildProcess::WaitUntil ( Deadline  deadline)

Wait for the child process to terminate. Returns if this did not happen until the specified Deadline has been reached.

◆ WaitUntil() [2/2]

template<typename Clock , typename Duration >
bool engine::subprocess::ChildProcess::WaitUntil ( std::chrono::time_point< Clock, Duration >  until)
inline

Wait for the child process to terminate.

Returns
false if this did not happen until the specified time point has been reached or a task cancellation

Definition at line 52 of file child_process.hpp.


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