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/utils/function_ref.hpp>
18#include <userver/utils/statistics/fwd.hpp>
19#include <userver/yaml_config/fwd.hpp>
21#include <userver/ugrpc/impl/statistics.hpp>
22#include <userver/ugrpc/server/middlewares/fwd.hpp>
23#include <userver/ugrpc/server/service_base.hpp>
25USERVER_NAMESPACE_BEGIN
30struct ServerConfig
final {
34 std::optional<
int>
port{0};
57 using SetupHook = utils::function_ref<
void(grpc::ServerBuilder&)>;
60 explicit Server(ServerConfig&& config,
61 utils::statistics::Storage& statistics_storage,
62 dynamic_config::Source config_source);
64 Server(Server&&) =
delete;
65 Server& operator=(Server&&) =
delete;
104 void StopDebug()
noexcept;
109 std::unique_ptr<Impl> impl_;