userver
C++ Async Framework
Loading...
Searching...
No Matches
service_base.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/ugrpc/server/service_base.hpp
4
/// @brief @copybrief ugrpc::server::ServiceBase
5
6
#
include
<
userver
/
engine
/
task
/
task_processor_fwd
.
hpp
>
7
8
#
include
<
userver
/
ugrpc
/
server
/
impl
/
service_worker
.
hpp
>
9
#
include
<
userver
/
ugrpc
/
server
/
middlewares
/
fwd
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
ugrpc::
server
{
14
15
/// Per-service settings
16
struct
ServiceConfig
final
{
17
/// TaskProcessor to use for serving RPCs.
18
engine::TaskProcessor&
task_processor
;
19
20
/// Server middlewares to use for the gRPC service.
21
Middlewares
middlewares
;
22
};
23
24
/// @brief The type-erased base class for all gRPC service implementations
25
/// @note User-defined services should inherit from code-generated base service
26
/// classes, not from this class directly.
27
class
ServiceBase
{
28
public
:
29
ServiceBase
& operator=(
ServiceBase
&&) =
delete
;
30
virtual
~ServiceBase();
31
32
/// @cond
33
// Creates a worker that forwards requests to this service.
34
// The service must be destroyed after the worker.
35
// For internal use only.
36
virtual
std::unique_ptr<impl::ServiceWorker> MakeWorker(
37
impl::ServiceSettings&& settings) = 0;
38
/// @endcond
39
};
40
41
}
// namespace ugrpc::server
42
43
USERVER_NAMESPACE_END
userver
ugrpc
server
service_base.hpp
Generated on Wed May 15 2024 22:26:36 for userver by
Doxygen
1.10.0