Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
grpc::ServerUnaryStreamer< RequestType, ResponseType > Class Template Referencefinal

#include <sync_stream.h>

Inheritance diagram for grpc::ServerUnaryStreamer< RequestType, ResponseType >:
Inheritance graph
[legend]

Public Member Functions

bool NextMessageSize (uint32_t *sz) override
 Get an upper bound on the request message size from the client. More...
 
bool Read (RequestType *request) override
 
void SendInitialMetadata () override
 
bool Write (const ResponseType &response, grpc::WriteOptions options) override
 
- Public Member Functions inherited from grpc::internal::ServerStreamingInterface
virtual ~ServerStreamingInterface ()
 
- Public Member Functions inherited from grpc::internal::WriterInterface< ResponseType >
bool Write (const ResponseType &msg)
 
void WriteLast (const ResponseType &msg, grpc::WriteOptions options)
 
virtual ~WriterInterface ()
 
- Public Member Functions inherited from grpc::internal::ReaderInterface< RequestType >
virtual ~ReaderInterface ()
 

Private Member Functions

 ServerUnaryStreamer (grpc::internal::Call *call, grpc::ServerContext *ctx)
 

Private Attributes

internal::ServerReaderWriterBody< ResponseType, RequestType > body_
 
bool read_done_
 
bool write_done_
 

Friends

class internal::TemplatedBidiStreamingHandler< ServerUnaryStreamer< RequestType, ResponseType >, true >
 

Detailed Description

template<class RequestType, class ResponseType>
class grpc::ServerUnaryStreamer< RequestType, ResponseType >

A class to represent a flow-controlled unary call. This is something of a hybrid between conventional unary and streaming. This is invoked through a unary call on the client side, but the server responds to it as though it were a single-ping-pong streaming call. The server can use the NextMessageSize method to determine an upper-bound on the size of the message. A key difference relative to streaming: ServerUnaryStreamer must have exactly 1 Read and exactly 1 Write, in that order, to function correctly. Otherwise, the RPC is in error.

Definition at line 827 of file grpcpp/impl/codegen/sync_stream.h.

Constructor & Destructor Documentation

◆ ServerUnaryStreamer()

template<class RequestType , class ResponseType >
grpc::ServerUnaryStreamer< RequestType, ResponseType >::ServerUnaryStreamer ( grpc::internal::Call call,
grpc::ServerContext ctx 
)
inlineprivate

Definition at line 883 of file grpcpp/impl/codegen/sync_stream.h.

Member Function Documentation

◆ NextMessageSize()

template<class RequestType , class ResponseType >
bool grpc::ServerUnaryStreamer< RequestType, ResponseType >::NextMessageSize ( uint32_t sz)
inlineoverridevirtual

Get an upper bound on the request message size from the client.

Implements grpc::internal::ReaderInterface< RequestType >.

Definition at line 837 of file grpcpp/impl/codegen/sync_stream.h.

◆ Read()

template<class RequestType , class ResponseType >
bool grpc::ServerUnaryStreamer< RequestType, ResponseType >::Read ( RequestType *  request)
inlineoverridevirtual

Read a message of type R into msg. Completion will be notified by tag on the associated completion queue. This is thread-safe with respect to Write or WritesDone methods. It should not be called concurrently with other streaming APIs on the same stream. It is not meaningful to call it concurrently with another ReaderInterface::Read on the same stream since reads on the same stream are delivered in order.

Parameters
[out]msgWhere to eventually store the read message.
[in]tagThe tag identifying the operation.

Implements grpc::internal::ReaderInterface< RequestType >.

Definition at line 851 of file grpcpp/impl/codegen/sync_stream.h.

◆ SendInitialMetadata()

template<class RequestType , class ResponseType >
void grpc::ServerUnaryStreamer< RequestType, ResponseType >::SendInitialMetadata ( )
inlineoverridevirtual

Block to send initial metadata to client. Implicit input parameter:

  • the ServerContext associated with this call will be used for sending initial metadata.

Implements grpc::internal::ServerStreamingInterface.

Definition at line 834 of file grpcpp/impl/codegen/sync_stream.h.

◆ Write()

template<class RequestType , class ResponseType >
bool grpc::ServerUnaryStreamer< RequestType, ResponseType >::Write ( const ResponseType &  msg,
grpc::WriteOptions  options 
)
inlineoverridevirtual

Block to write msg to the stream with WriteOptions options. This is thread-safe with respect to ReaderInterface::Read

Parameters
msgThe message to be written to the stream.
optionsThe WriteOptions affecting the write operation.
Returns
true on success, false when the stream has been closed.

Implements grpc::internal::WriterInterface< ResponseType >.

Definition at line 867 of file grpcpp/impl/codegen/sync_stream.h.

Friends And Related Function Documentation

◆ internal::TemplatedBidiStreamingHandler< ServerUnaryStreamer< RequestType, ResponseType >, true >

template<class RequestType , class ResponseType >
friend class internal::TemplatedBidiStreamingHandler< ServerUnaryStreamer< RequestType, ResponseType >, true >
friend

Definition at line 882 of file grpcpp/impl/codegen/sync_stream.h.

Member Data Documentation

◆ body_

template<class RequestType , class ResponseType >
internal::ServerReaderWriterBody<ResponseType, RequestType> grpc::ServerUnaryStreamer< RequestType, ResponseType >::body_
private

Definition at line 877 of file grpcpp/impl/codegen/sync_stream.h.

◆ read_done_

template<class RequestType , class ResponseType >
bool grpc::ServerUnaryStreamer< RequestType, ResponseType >::read_done_
private

Definition at line 878 of file grpcpp/impl/codegen/sync_stream.h.

◆ write_done_

template<class RequestType , class ResponseType >
bool grpc::ServerUnaryStreamer< RequestType, ResponseType >::write_done_
private

Definition at line 879 of file grpcpp/impl/codegen/sync_stream.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:31