userver: userver/ugrpc/server/service_base.hpp Source File
Loading...
Searching...
No Matches
service_base.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <boost/container/flat_map.hpp>
7
10
12#include <userver/ugrpc/server/impl/service_worker.hpp>
15
16USERVER_NAMESPACE_BEGIN
17
18namespace ugrpc::server {
19
20namespace impl {
21struct ServiceInternals;
22} // namespace impl
23
25struct ServiceConfig final {
27 engine::TaskProcessor& task_processor;
28
31
34 boost::container::flat_map<grpc::StatusCode, logging::Level> status_codes_log_level;
35
38
42 bool use_protobuf_arena{false};
43};
44
49public:
50 using CallContext = ugrpc::server::CallContext;
51
52 ServiceBase& operator=(ServiceBase&&) = delete;
53 virtual ~ServiceBase();
54
56 // For internal use only.
57 virtual ugrpc::impl::StaticServiceMetadata GetMetadata(utils::impl::InternalTag) const = 0;
58
59 // Creates a worker that forwards requests to this service.
60 // The service must be destroyed after the worker.
61 // For internal use only.
62 virtual std::unique_ptr<impl::ServiceWorker> MakeWorker(impl::ServiceInternals&& internals) = 0;
64};
65
66} // namespace ugrpc::server
67
68USERVER_NAMESPACE_END