userver: engine::subprocess::ProcessStarter Class Reference
Loading...
Searching...
No Matches
engine::subprocess::ProcessStarter Class Reference

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

Detailed Description

Creates a new OS subprocess and executes a command in it.

Definition at line 26 of file process_starter.hpp.

Public Member Functions

 ProcessStarter (TaskProcessor &task_processor)
 
ChildProcess Exec (const std::string &command, const std::vector< std::string > &args, const EnvironmentVariables &env, const std::optional< std::string > &stdout_file=std::nullopt, const std::optional< std::string > &stderr_file=std::nullopt)
 
ChildProcess Exec (const std::string &command, const std::vector< std::string > &args, EnvironmentVariablesUpdate env_update=EnvironmentVariablesUpdate{{}}, const std::optional< std::string > &stdout_file=std::nullopt, const std::optional< std::string > &stderr_file=std::nullopt)
 

Constructor & Destructor Documentation

◆ ProcessStarter()

engine::subprocess::ProcessStarter::ProcessStarter ( TaskProcessor & task_processor)
explicit
Parameters
task_processorwill be used for executing asynchronous fork + exec. `main-task-processor is OK for this purpose.

Member Function Documentation

◆ Exec() [1/2]

ChildProcess engine::subprocess::ProcessStarter::Exec ( const std::string & command,
const std::vector< std::string > & args,
const EnvironmentVariables & env,
const std::optional< std::string > & stdout_file = std::nullopt,
const std::optional< std::string > & stderr_file = std::nullopt )
Parameters
commandthe absolute path to the executable
argsexact args passed to the executable
envredefines all environment variables

◆ Exec() [2/2]

ChildProcess engine::subprocess::ProcessStarter::Exec ( const std::string & command,
const std::vector< std::string > & args,
EnvironmentVariablesUpdate env_update = EnvironmentVariablesUpdate{{}},
const std::optional< std::string > & stdout_file = std::nullopt,
const std::optional< std::string > & stderr_file = std::nullopt )
Parameters
commandthe absolute path to the executable
argsexact args passed to the executable
env_updatevariables to add to the current environment, overwriting existing ones

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