userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
run.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/components/run.hpp
4
/// @brief Functions to start a service or tool with the specified
5
/// config and components::ComponentList.
6
7
#
include
<
string
>
8
9
#
include
<
userver
/
components
/
component_list
.
hpp
>
10
#
include
<
userver
/
utils
/
strong_typedef
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
/// Contains functions and types to start a userver based service/tool.
15
namespace
components
{
16
17
/// Data type to distinguish config path and in-memory config values in
18
/// components::Run() and components::RunOnce() functions.
19
struct
InMemoryConfig
:
utils
::StrongTypedef<
InMemoryConfig
, std::string> {
20
using
StrongTypedef::StrongTypedef;
21
};
22
23
/// Starts a server with the provided component list and config loaded from
24
/// file. Reopens the logging files on SIGUSR1.
25
///
26
/// @see utils::DaemonMain
27
void
Run
(
28
const
std::string& config_path,
29
const
std::optional<std::string>& config_vars_path,
30
const
std::optional<std::string>& config_vars_override_path,
31
const
ComponentList& component_list
32
);
33
34
/// Starts a server with the provided component list and config.
35
/// Reopens the logging files on SIGUSR1.
36
///
37
/// @see utils::DaemonMain
38
void
Run
(
const
InMemoryConfig
& config,
const
ComponentList& component_list);
39
40
/// Runs the component list once with the config loaded from file.
41
///
42
/// @see utils::DaemonMain
43
void
RunOnce
(
44
const
std::string& config_path,
45
const
std::optional<std::string>& config_vars_path,
46
const
std::optional<std::string>& config_vars_override_path,
47
const
ComponentList& component_list
48
);
49
50
/// Runs the component list once with the config.
51
///
52
/// @see utils::DaemonMain
53
void
RunOnce
(
const
InMemoryConfig
& config,
const
ComponentList& component_list);
54
55
/// Requests stop of the component system.
56
/// The service will be eventually stopped.
57
void
RequestStop
();
58
59
namespace
impl {
60
61
// Composes a single static config schema from all components.
62
std::string GetStaticConfigSchema(
const
ComponentList& component_list);
63
64
std::string GetDynamicConfigDefaults();
65
66
}
// namespace impl
67
68
}
// namespace components
69
70
USERVER_NAMESPACE_END
userver
components
run.hpp
Generated on
for userver by
Doxygen
1.17.0