Public Member Functions | Private Member Functions | Private Attributes | List of all members
grpc::ServerAsyncReader< W, R > Class Template Referencefinal

#include <async_stream.h>

Inheritance diagram for grpc::ServerAsyncReader< W, R >:
Inheritance graph
[legend]

Public Member Functions

void Finish (const W &msg, const grpc::Status &status, void *tag) override
 
void FinishWithError (const grpc::Status &status, void *tag) override
 
void Read (R *msg, void *tag) override
 
void SendInitialMetadata (void *tag) override
 
 ServerAsyncReader (grpc::ServerContext *ctx)
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual ~ServerAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc::internal::AsyncReaderInterface< R >
virtual ~AsyncReaderInterface ()
 

Private Member Functions

void BindCall (grpc::internal::Call *call) override
 

Private Attributes

grpc::internal::Call call_
 
grpc::ServerContextctx_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpServerSendStatusfinish_ops_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadatameta_ops_
 
grpc::internal::CallOpSet< grpc::internal::CallOpRecvMessage< R > > read_ops_
 

Detailed Description

template<class W, class R>
class grpc::ServerAsyncReader< W, R >

Async server-side API for doing client-streaming RPCs, where the incoming message stream from the client has messages of type R, and the single response message sent from the server is type W.

Definition at line 698 of file grpcpp/impl/codegen/async_stream.h.

Constructor & Destructor Documentation

◆ ServerAsyncReader()

template<class W , class R >
grpc::ServerAsyncReader< W, R >::ServerAsyncReader ( grpc::ServerContext ctx)
inlineexplicit

Definition at line 700 of file grpcpp/impl/codegen/async_stream.h.

Member Function Documentation

◆ BindCall()

template<class W , class R >
void grpc::ServerAsyncReader< W, R >::BindCall ( grpc::internal::Call call)
inlineoverrideprivatevirtual

◆ Finish()

template<class W , class R >
void grpc::ServerAsyncReader< W, R >::Finish ( const W msg,
const grpc::Status status,
void *  tag 
)
inlineoverridevirtual

See the ServerAsyncReaderInterface.Read method for semantics

Side effect:

  • also sends initial metadata if not alreay sent.
  • uses the ServerContext associated with this call to send possible initial and trailing metadata.

Note: msg is not sent if status has a non-OK code.

gRPC doesn't take ownership or a reference to msg and status, so it is safe to deallocate once Finish returns.

Implements grpc::ServerAsyncReaderInterface< W, R >.

Definition at line 738 of file grpcpp/impl/codegen/async_stream.h.

◆ FinishWithError()

template<class W , class R >
void grpc::ServerAsyncReader< W, R >::FinishWithError ( const grpc::Status status,
void *  tag 
)
inlineoverridevirtual

See the ServerAsyncReaderInterface.Read method for semantics

Side effect:

  • also sends initial metadata if not alreay sent.
  • uses the ServerContext associated with this call to send possible initial and trailing metadata.

gRPC doesn't take ownership or a reference to status, so it is safe to to deallocate once FinishWithError returns.

Implements grpc::ServerAsyncReaderInterface< W, R >.

Definition at line 767 of file grpcpp/impl/codegen/async_stream.h.

◆ Read()

template<class W , class R >
void grpc::ServerAsyncReader< W, R >::Read ( R *  msg,
void *  tag 
)
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 AsyncReaderInterface::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.

Side effect: note that this method attempt to receive initial metadata for a stream if it hasn't yet been received.

Implements grpc::internal::AsyncReaderInterface< R >.

Definition at line 721 of file grpcpp/impl/codegen/async_stream.h.

◆ SendInitialMetadata()

template<class W , class R >
void grpc::ServerAsyncReader< W, R >::SendInitialMetadata ( void *  tag)
inlineoverridevirtual

See ServerAsyncStreamingInterface::SendInitialMetadata for semantics.

Implicit input parameter:

  • The initial metadata that will be sent to the client from this op will be taken from the ServerContext associated with the call.

Implements grpc::internal::ServerAsyncStreamingInterface.

Definition at line 708 of file grpcpp/impl/codegen/async_stream.h.

Member Data Documentation

◆ call_

template<class W , class R >
grpc::internal::Call grpc::ServerAsyncReader< W, R >::call_
private

Definition at line 785 of file grpcpp/impl/codegen/async_stream.h.

◆ ctx_

template<class W , class R >
grpc::ServerContext* grpc::ServerAsyncReader< W, R >::ctx_
private

Definition at line 786 of file grpcpp/impl/codegen/async_stream.h.

◆ finish_ops_

Definition at line 793 of file grpcpp/impl/codegen/async_stream.h.

◆ meta_ops_

template<class W , class R >
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> grpc::ServerAsyncReader< W, R >::meta_ops_
private

Definition at line 788 of file grpcpp/impl/codegen/async_stream.h.

◆ read_ops_

template<class W , class R >
grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R> > grpc::ServerAsyncReader< W, R >::read_ops_
private

Definition at line 789 of file grpcpp/impl/codegen/async_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