8#include <unordered_map>
10#include <grpcpp/completion_queue.h>
11#include <grpcpp/server_builder.h>
13#include <userver/dynamic_config/source.hpp>
14#include <userver/engine/task/task_processor_fwd.hpp>
15#include <userver/logging/level.hpp>
16#include <userver/logging/null_logger.hpp>
17#include <userver/server/congestion_control/sensor.hpp>
18#include <userver/utils/function_ref.hpp>
19#include <userver/utils/impl/internal_tag.hpp>
20#include <userver/utils/statistics/fwd.hpp>
21#include <userver/yaml_config/fwd.hpp>
23#include <userver/ugrpc/impl/statistics.hpp>
24#include <userver/ugrpc/server/middlewares/fwd.hpp>
25#include <userver/ugrpc/server/service_base.hpp>
27USERVER_NAMESPACE_BEGIN
29namespace ugrpc::impl {
30class CompletionQueuePoolBase;
39 std::optional<std::string> ca;
42 std::optional<std::string> key;
45 std::optional<std::string> cert;
49struct ServerConfig
final {
53 std::optional<
int>
port{0};
85class Server
final :
public USERVER_NAMESPACE::server::congestion_control::
RequestsSource {
87 using SetupHook = utils::function_ref<
void(grpc::ServerBuilder&)>;
91 ServerConfig&& config,
92 utils::statistics::Storage& statistics_storage,
93 dynamic_config::Source config_source
96 Server(Server&&) =
delete;
97 Server& operator=(Server&&) =
delete;
136 std::uint64_t GetTotalRequests()
const override;
139 ugrpc::impl::CompletionQueuePoolBase& GetCompletionQueues(
utils::impl::InternalTag);
144 std::unique_ptr<Impl> impl_;