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;
38struct ServerConfig
final {
42 std::optional<
int>
port{0};
72 :
public USERVER_NAMESPACE::server::congestion_control::
RequestsSource {
74 using SetupHook = utils::function_ref<
void(grpc::ServerBuilder&)>;
77 explicit Server(ServerConfig&& config,
78 utils::statistics::Storage& statistics_storage,
79 dynamic_config::Source config_source);
81 Server(Server&&) =
delete;
82 Server& operator=(Server&&) =
delete;
121 std::uint64_t GetTotalRequests()
const override;
124 ugrpc::impl::CompletionQueuePoolBase& GetCompletionQueues(
125 utils::impl::InternalTag);
130 std::unique_ptr<Impl> impl_;