7#include <userver/clients/http/cancellation_policy.hpp>
8#include <userver/dynamic_config/fwd.hpp>
9#include <userver/formats/json_fwd.hpp>
10#include <userver/yaml_config/fwd.hpp>
12namespace dynamic_config::http_client_connect_throttle {
13struct VariableTypeRaw;
14using VariableType = VariableTypeRaw;
17USERVER_NAMESPACE_BEGIN
23namespace clients::http {
26 bool update_header{
true};
30struct ClientSettings
final {
31 std::string thread_name_prefix{};
35 CancellationPolicy cancellation_policy{CancellationPolicy::kCancel};
42namespace clients::http::impl {
44struct ThrottleConfig
final {
45 static constexpr size_t kNoLimit = -1;
47 std::size_t http_connect_limit{kNoLimit};
48 std::chrono::microseconds http_connect_rate{0};
49 std::size_t https_connect_limit{kNoLimit};
50 std::chrono::microseconds https_connect_rate{0};
51 std::size_t per_host_connect_limit{kNoLimit};
52 std::chrono::microseconds per_host_connect_rate{0};
55ThrottleConfig Parse(
const ::dynamic_config::http_client_connect_throttle::VariableType&);
59 static constexpr std::size_t kDefaultConnectionPoolSize = 10000;
61 std::size_t connection_pool_size{kDefaultConnectionPoolSize};
62 ThrottleConfig throttle;