userver: userver/components/process_starter.hpp Source File
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
process_starter.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/components/process_starter.hpp
4/// @brief @copybrief components::ProcessStarter
5
6#include <userver/components/loggable_component_base.hpp>
7
8#include <userver/engine/subprocess/process_starter.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace components {
13
14/// @ingroup userver_components
15///
16/// @brief Component for getting the engine::subprocess::ProcessStarter.
17///
18/// ## Static options:
19/// Name | Description | Default value
20/// ---- | ----------- | -------------
21/// task_processor | the name of the TaskProcessor for process starting | -
23 public:
24 ProcessStarter(const ComponentConfig& config,
25 const ComponentContext& context);
26
27 /// @ingroup userver_component_names
28 /// @brief The default name of components::ProcessStarter component
29 static constexpr std::string_view kName = "process-starter";
30
31 engine::subprocess::ProcessStarter& Get() { return process_starter_; }
32
33 static yaml_config::Schema GetStaticConfigSchema();
34
35 private:
36 engine::subprocess::ProcessStarter process_starter_;
37};
38
39template <>
40inline constexpr bool kHasValidate<ProcessStarter> = true;
41
42} // namespace components
43
44USERVER_NAMESPACE_END