userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/clients/http/config.hpp
4
/// @brief HTTP client static and dynamic configuration types
5
6
#
include
<
chrono
>
7
#
include
<
optional
>
8
#
include
<
string
>
9
10
#
include
<
userver
/
clients
/
http
/
cancellation_policy
.
hpp
>
11
#
include
<
userver
/
dynamic_config
/
fwd
.
hpp
>
12
#
include
<
userver
/
formats
/
json_fwd
.
hpp
>
13
#
include
<
userver
/
yaml_config
/
fwd
.
hpp
>
14
15
namespace
dynamic_config::http_client_connect_throttle {
16
struct
VariableTypeRaw;
17
using
VariableType = VariableTypeRaw;
18
}
// namespace dynamic_config::http_client_connect_throttle
19
20
USERVER_NAMESPACE_BEGIN
21
22
namespace
tracing
{
23
class
TracingManagerBase
;
24
}
// namespace tracing
25
26
namespace
clients::http {
27
28
struct
DeadlinePropagationConfig
{
29
bool
update_header{
true
};
30
};
31
32
// Static config
33
struct
ClientSettings
final
{
34
std::string thread_name_prefix{};
35
size_t io_threads{8};
36
DeadlinePropagationConfig
deadline_propagation{};
37
const
tracing
::
TracingManagerBase
* tracing_manager{
nullptr
};
38
CancellationPolicy
cancellation_policy{
CancellationPolicy
::kCancel};
39
};
40
41
ClientSettings Parse(
const
yaml_config::
YamlConfig
& value, formats::
parse
::
To
<ClientSettings>);
42
43
}
// namespace clients::http
44
45
namespace
clients::http::impl {
46
47
struct
ThrottleConfig
final
{
48
static
constexpr
size_t kNoLimit = -1;
49
50
std::size_t http_connect_limit{kNoLimit};
51
std::chrono::microseconds http_connect_rate{0};
52
std::size_t https_connect_limit{kNoLimit};
53
std::chrono::microseconds https_connect_rate{0};
54
std::size_t per_host_connect_limit{kNoLimit};
55
std::chrono::microseconds per_host_connect_rate{0};
56
};
57
58
ThrottleConfig Parse(
const
::dynamic_config::http_client_connect_throttle::VariableType&);
59
60
// Dynamic config
61
struct
Config
final
{
62
static
constexpr
std::size_t kDefaultConnectionPoolSize = 10000;
63
64
std::size_t connection_pool_size{kDefaultConnectionPoolSize};
65
ThrottleConfig throttle;
66
};
67
68
}
// namespace clients::http::impl
69
70
USERVER_NAMESPACE_END
userver
clients
http
config.hpp
Generated on
for userver by
Doxygen
1.17.0