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