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// clang-format off
15
16/// @ingroup userver_components
17///
18/// @brief Component for getting the engine::subprocess::ProcessStarter.
19///
20/// ## Static options:
21/// Name | Description | Default value
22/// ---- | ----------- | -------------
23/// task_processor | the name of the TaskProcessor for asynchronous process starting | `main-task-processor`
24
25// clang-format on
26class ProcessStarter final : public ComponentBase {
27public:
28 /// @ingroup userver_component_names
29 /// @brief The default name of components::ProcessStarter component
30 static constexpr std::string_view kName = "process-starter";
31
32 ProcessStarter(const ComponentConfig& config, const ComponentContext& context);
33
34 engine::subprocess::ProcessStarter& Get() { return process_starter_; }
35
36 static yaml_config::Schema GetStaticConfigSchema();
37
38private:
39 engine::subprocess::ProcessStarter process_starter_;
40};
41
42template <>
43inline constexpr bool kHasValidate<ProcessStarter> = true;
44
45} // namespace components
46
47USERVER_NAMESPACE_END