6#include <userver/dynamic_config/fwd.hpp>
7#include <userver/formats/json_fwd.hpp>
8#include <userver/yaml_config/fwd.hpp>
10USERVER_NAMESPACE_BEGIN
16namespace server::http {
17class HeadersPropagator;
20namespace clients::
http {
23 bool update_header{
true};
26enum class CancellationPolicy {
32 formats::
parse::
To<CancellationPolicy>);
35struct ClientSettings
final {
36 std::string thread_name_prefix{};
38 bool defer_events{
false};
41 const server::http::HeadersPropagator* headers_propagator{
nullptr};
42 CancellationPolicy cancellation_policy{CancellationPolicy::kCancel};
46 formats::
parse::
To<ClientSettings>);
50namespace clients::
http::impl {
52struct ThrottleConfig
final {
53 static constexpr size_t kNoLimit = -1;
55 std::size_t http_connect_limit{kNoLimit};
56 std::chrono::microseconds http_connect_rate{0};
57 std::size_t https_connect_limit{kNoLimit};
58 std::chrono::microseconds https_connect_rate{0};
59 std::size_t per_host_connect_limit{kNoLimit};
60 std::chrono::microseconds per_host_connect_rate{0};
63ThrottleConfig Parse(
const formats::
json::Value& value,
64 formats::
parse::
To<ThrottleConfig>);
68 static constexpr std::size_t kDefaultConnectionPoolSize = 10000;
70 std::size_t connection_pool_size{kDefaultConnectionPoolSize};
72 ThrottleConfig throttle;
75Config ParseConfig(
const dynamic_config::DocsMap& docs_map);