Skip to content

TExchangeRPCBackend

gRPC exchange backend: async request/response pairing for bidirectional RPCs.

template <class ServiceType, typename RequestType, typename ResponseType>
class TExchangeRPCBackend
: public TRPCBackend<ServiceType, RequestType, ResponseType>,
public IExchangeBackend<RequestType, ResponseType>

Methods

TExchangeRPCBackend

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

Parameters

  • TargetRPC (gRPCBackend::AsyncRPCHandle)

  • Service (std::shared_ptr<ServiceType>)

  • CQueue (std::unique_ptr<ServerCompletionQueue>)


TExchangeRPCBackend

inline ~TExchangeRPCBackend()

Receive

inline virtual TFuture<const RequestType *> Receive() override

Initiate an Exchange with the Client.


Respond

inline virtual void Respond(ResponseType *Response) override

Respond to a message from the client.

Parameters

  • Response (ResponseType)

Initialize

inline virtual void Initialize()

Perform any setup that happens prior to establishing any external connection.


Start

inline virtual void Start()

Starts the exchange completion-queue worker thread.


Establish

inline virtual void Establish()

Perform any setup that involves handshakes with the external communication (e.g.


Shutdown

inline virtual void Shutdown() override

Close the external connection.


Restart

inline virtual void Restart()

Reset the Communication backend.


Reset

inline virtual void Reset() override

Reset the backend to clear any stale exchange state from previous connections.

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