Skip to content

TRPCBackend

Base for async gRPC server backends sharing a completion queue and service instance.

Subclassed by TConsumerRPCBackend< ServiceType, RequestType, ResponseType >, TExchangeRPCBackend< ServiceType, RequestType, ResponseType >, TProducerRPCBackend< ServiceType, RequestType, ResponseType >

template <class ServiceType, typename RequestType, typename ResponseType>
class TRPCBackend

Methods

Public

TRPCBackend

inline TRPCBackend(AsyncRPCHandle TargetRPC,
std::shared_ptr<ServiceType> Service,
std::unique_ptr<ServerCompletionQueue> CQueue)

Parameters

  • TargetRPC (AsyncRPCHandle)

  • Service (std::shared_ptr<ServiceType>)

  • CQueue (std::unique_ptr<ServerCompletionQueue>)


SetCompletionQueue

inline void SetCompletionQueue(std::unique_ptr<ServerCompletionQueue> CQueue)

Parameters

  • CQueue (std::unique_ptr<ServerCompletionQueue>)

Protected

AsyncRPCHandle

using AsyncRPCHandle =
void (ServiceType::*)(grpc::ServerContext *context, RequestType *request,
ServerAsyncResponseWriter<ResponseType> *response,
grpc::CompletionQueue *new_call_cq,
ServerCompletionQueue *notification_cq, void *tag)

The signature of the handler for an asynchronous RPC, that is handled by this CallData.

Parameters

  • context (ServiceType::*)(grpc::ServerContext)

  • request (RequestType)

  • response (ServerAsyncResponseWriter<ResponseType>)

  • new_call_cq (grpc::CompletionQueue)

  • notification_cq (ServerCompletionQueue)

  • tag (void)

Attributes

Protected

_CQueue

std::unique_ptr<ServerCompletionQueue> _CQueue

Server completion queue used for async RPC tags and polling.


Service

std::shared_ptr<ServiceType> Service

gRPC service instance registered with the server.


Server

std::unique_ptr<Server> Server

gRPC server owning the service and queues.


TargetRPC

AsyncRPCHandle TargetRPC

Member pointer to the service method that begins this async RPC.

Source: Source/ScholaProtobuf/Public/ProtobufBackends/gRPC/RPCBackend.h