userver
C++ Async Framework
Loading...
Searching...
No Matches
restart.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/server/handlers/restart.hpp
4
/// @brief @copybrief server::handlers::Restart
5
6
#
include
<
atomic
>
7
8
#
include
<
userver
/
server
/
handlers
/
http_handler_base
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
server::handlers {
13
14
// clang-format off
15
16
/// @ingroup userver_components userver_http_handlers
17
///
18
/// @brief Handler that stops the service. It is expected that an external system
19
/// (e.g. systemd or supervisord) restarts the service afterwards.
20
///
21
/// The handler uses monitor port.
22
///
23
/// The component has no service configuration except the
24
/// @ref userver_http_handlers "common handler options".
25
26
// clang-format on
27
28
class
Restart
final
:
public
HttpHandlerBase
{
29
public
:
30
Restart(
const
components
::ComponentConfig&,
const
components
::ComponentContext&);
31
32
/// @ingroup userver_component_names
33
/// @brief The default name of server::handlers::Restart
34
static
constexpr
std
::
string_view
kName
=
"handler-restart"
;
35
36
std::string
HandleRequestThrow
(
const
http
::HttpRequest&,
request
::RequestContext&)
const
override
;
37
38
components
::
ComponentHealth
GetComponentHealth
()
const
override
;
39
40
private
:
41
mutable
std::atomic<
components
::
ComponentHealth
> health_;
42
};
43
44
}
// namespace server::handlers
45
46
USERVER_NAMESPACE_END
userver
server
handlers
restart.hpp
Generated on Wed Dec 4 2024 18:46:21 for userver by
Doxygen
1.10.0