-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat clients: enable deadline propagation by default
- Loading branch information
Showing
69 changed files
with
249 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
#include <string> | ||
|
||
#include <userver/dynamic_config/fwd.hpp> | ||
#include <userver/formats/json_fwd.hpp> | ||
#include <userver/yaml_config/fwd.hpp> | ||
|
||
USERVER_NAMESPACE_BEGIN | ||
|
||
namespace tracing { | ||
class TracingManagerBase; | ||
} // namespace tracing | ||
|
||
namespace server::http { | ||
class HeadersPropagator; | ||
} // namespace server::http | ||
|
||
namespace clients::http::impl { | ||
|
||
struct DeadlinePropagationConfig { | ||
bool update_header{true}; | ||
}; | ||
|
||
// Static config | ||
struct ClientSettings final { | ||
std::string thread_name_prefix{}; | ||
size_t io_threads{8}; | ||
bool defer_events{false}; | ||
DeadlinePropagationConfig deadline_propagation{}; | ||
const tracing::TracingManagerBase* tracing_manager{nullptr}; | ||
const server::http::HeadersPropagator* headers_propagator{nullptr}; | ||
}; | ||
|
||
ClientSettings Parse(const yaml_config::YamlConfig& value, | ||
formats::parse::To<ClientSettings>); | ||
|
||
struct ThrottleConfig final { | ||
static constexpr size_t kNoLimit = -1; | ||
|
||
std::size_t http_connect_limit{kNoLimit}; | ||
std::chrono::microseconds http_connect_rate{0}; | ||
std::size_t https_connect_limit{kNoLimit}; | ||
std::chrono::microseconds https_connect_rate{0}; | ||
std::size_t per_host_connect_limit{kNoLimit}; | ||
std::chrono::microseconds per_host_connect_rate{0}; | ||
}; | ||
|
||
ThrottleConfig Parse(const formats::json::Value& value, | ||
formats::parse::To<ThrottleConfig>); | ||
|
||
// Dynamic config | ||
struct Config final { | ||
static constexpr std::size_t kDefaultConnectionPoolSize = 10000; | ||
|
||
std::size_t connection_pool_size{kDefaultConnectionPoolSize}; | ||
std::string proxy; | ||
ThrottleConfig throttle; | ||
}; | ||
|
||
Config ParseConfig(const dynamic_config::DocsMap& docs_map); | ||
|
||
} // namespace clients::http::impl | ||
|
||
USERVER_NAMESPACE_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.