userver: ugrpc::server::ReaderWriter< Request, Response > Class Template Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
ugrpc::server::ReaderWriter< Request, Response > Class Template Referenceabstract

#include <userver/ugrpc/server/stream.hpp>

Detailed Description

template<class Request, class Response>
class ugrpc::server::ReaderWriter< Request, Response >

Interface to both read and write messages.

If any method throws, further methods must not be called on the same stream.

This class allows the following concurrent calls:

  • Read;
  • Write

and there can only be one Read and one Write in flight at a time.

If any method throws, further methods must not be called on the same stream.

Definition at line 67 of file stream.hpp.

+ Inheritance diagram for ugrpc::server::ReaderWriter< Request, Response >:

Public Member Functions

virtual bool Read (Request &request)=0
 Await and read the next incoming message.
 
virtual void Write (Response &response)=0
 Write the next outgoing message.
 
virtual void Write (Response &&response)=0
 Write the next outgoing message.
 

Member Function Documentation

◆ Read()

template<class Request>
virtual bool ugrpc::server::Reader< Request >::Read ( Request & request)
nodiscardpure virtualinherited

Await and read the next incoming message.

Parameters
requestwhere to put the request on success
Returns
true on success, false on end-of-input
Exceptions
ugrpc::server::RpcErroron an RPC error

◆ Write() [1/2]

template<class Response>
virtual void ugrpc::server::Writer< Response >::Write ( Response && response)
pure virtualinherited

Write the next outgoing message.

Parameters
responsethe next message to write
Exceptions
ugrpc::server::RpcErroron an RPC error
std::exception(internal) on error from middlewares

◆ Write() [2/2]

template<class Response>
virtual void ugrpc::server::Writer< Response >::Write ( Response & response)
pure virtualinherited

Write the next outgoing message.

Parameters
responsethe next message to write
Exceptions
ugrpc::server::RpcErroron an RPC error
std::exception(internal) on error from middlewares

The documentation for this class was generated from the following file: