userver: grpc_proto_structs::server::ReaderWriter< Request, Response > Class Template Reference
Loading...
Searching...
No Matches
grpc_proto_structs::server::ReaderWriter< Request, Response > Class Template Reference

#include </data/code/userver/libraries/grpc-proto-structs/include/userver/grpc-proto-structs/server/stream.hpp>

Detailed Description

template<typename Request, typename Response>
class grpc_proto_structs::server::ReaderWriter< Request, Response >

proto-struct based ReaderWriter adapter

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.

See also
ugrpc::server::ReaderWriter.

Definition at line 99 of file stream.hpp.

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

Public Types

using ProtobufMessageReaderWriter
 
using RequestMessage = proto_structs::traits::CompatibleMessageType<Request>
 
using ProtobufMessageReader = ugrpc::server::Reader<RequestMessage>
 
using ResponseMessage = proto_structs::traits::CompatibleMessageType<Response>
 
using ProtobufMessageWriter = ugrpc::server::Writer<ResponseMessage>
 

Public Member Functions

 ReaderWriter (ProtobufMessageReaderWriter &reader_writer)
 
bool Read (Request &request)
 Await and read the next incoming message.
 
void Write (Response &response)
 Write the next outgoing message.
 
void Write (Response &response, const grpc::WriteOptions &options)
 
void Write (Response &&response)
 
void Write (Response &&response, const grpc::WriteOptions &options)
 

Member Typedef Documentation

◆ ProtobufMessageReader

template<typename Request>
using grpc_proto_structs::server::Reader< Request >::ProtobufMessageReader = ugrpc::server::Reader<RequestMessage>
inherited

Definition at line 25 of file stream.hpp.

◆ ProtobufMessageReaderWriter

template<typename Request, typename Response>
using grpc_proto_structs::server::ReaderWriter< Request, Response >::ProtobufMessageReaderWriter
Initial value:
ugrpc::server::
ReaderWriter<typename Reader<Request>::RequestMessage, typename Writer<Response>::ResponseMessage>

Definition at line 101 of file stream.hpp.

◆ ProtobufMessageWriter

template<typename Response>
using grpc_proto_structs::server::Writer< Response >::ProtobufMessageWriter = ugrpc::server::Writer<ResponseMessage>
inherited

Definition at line 58 of file stream.hpp.

◆ RequestMessage

template<typename Request>
using grpc_proto_structs::server::Reader< Request >::RequestMessage = proto_structs::traits::CompatibleMessageType<Request>
inherited

Definition at line 24 of file stream.hpp.

◆ ResponseMessage

template<typename Response>
using grpc_proto_structs::server::Writer< Response >::ResponseMessage = proto_structs::traits::CompatibleMessageType<Response>
inherited

Definition at line 57 of file stream.hpp.

Constructor & Destructor Documentation

◆ ReaderWriter()

template<typename Request, typename Response>
grpc_proto_structs::server::ReaderWriter< Request, Response >::ReaderWriter ( ProtobufMessageReaderWriter< Request, Response > & reader_writer)
inlineexplicit

Definition at line 104 of file stream.hpp.

Member Function Documentation

◆ Read()

template<typename Request>
bool grpc_proto_structs::server::Reader< Request >::Read ( Request & request)
inlineinherited

Await and read the next incoming message.

Read protobuf message corresponding to Request with ugrpc::server::Reader::Read and construct Request from it.

See also
ugrpc::server::Reader::Read method for details.

Definition at line 35 of file stream.hpp.

◆ Write() [1/4]

template<typename Response>
void grpc_proto_structs::server::Writer< Response >::Write ( Response && response)
inlineinherited

Definition at line 74 of file stream.hpp.

◆ Write() [2/4]

template<typename Response>
void grpc_proto_structs::server::Writer< Response >::Write ( Response && response,
const grpc::WriteOptions & options )
inlineinherited

Definition at line 76 of file stream.hpp.

◆ Write() [3/4]

template<typename Response>
void grpc_proto_structs::server::Writer< Response >::Write ( Response & response)
inlineinherited

Write the next outgoing message.

Convert response to corresponding protobuf message and pass it to ugrpc::server::Writer::Write.

See also
ugrpc::server::Writer::Write method for details.

Definition at line 68 of file stream.hpp.

◆ Write() [4/4]

template<typename Response>
void grpc_proto_structs::server::Writer< Response >::Write ( Response & response,
const grpc::WriteOptions & options )
inlineinherited

Definition at line 70 of file stream.hpp.


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