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/statistics/fwd.hpp>
20#include <userver/yaml_config/fwd.hpp>
22#include <userver/ugrpc/impl/statistics.hpp>
23#include <userver/ugrpc/server/middlewares/fwd.hpp>
24#include <userver/ugrpc/server/service_base.hpp>
26USERVER_NAMESPACE_BEGIN
31struct ServerConfig
final {
35 std::optional<
int>
port{0};
65 :
public USERVER_NAMESPACE::server::congestion_control::
RequestsSource {
67 using SetupHook = utils::function_ref<
void(grpc::ServerBuilder&)>;
70 explicit Server(ServerConfig&& config,
71 utils::statistics::Storage& statistics_storage,
72 dynamic_config::Source config_source);
74 Server(Server&&) =
delete;
75 Server& operator=(Server&&) =
delete;
115 std::uint64_t GetTotalRequests()
const override;
119 std::unique_ptr<Impl> impl_;