userver: userver/components/process_starter.hpp Source File
Loading...
Searching...
No Matches
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/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 of components::ProcessStarter :
19/// @include{doc} scripts/docs/en/components_schema/core/src/components/process_starter.md
20///
21/// Options inherited from @ref components::ComponentBase :
22/// @include{doc} scripts/docs/en/components_schema/core/src/components/impl/component_base.md
23class ProcessStarter final : public ComponentBase {
24public:
25 /// @ingroup userver_component_names
26 /// @brief The default name of @ref components::ProcessStarter component
27 static constexpr std::string_view kName = "process-starter";
28
29 ProcessStarter(const ComponentConfig& config, const ComponentContext& context);
30
31 engine::subprocess::ProcessStarter& Get() { return process_starter_; }
32
33 static yaml_config::Schema GetStaticConfigSchema();
34
35private:
36 engine::subprocess::ProcessStarter process_starter_;
37};
38
39template <>
40inline constexpr bool kHasValidate<ProcessStarter> = true;
41
42} // namespace components
43
44USERVER_NAMESPACE_END