GRPC C++  1.30.0
Public Member Functions
grpc_impl::ServerAsyncReader< W, R > Class Template Referencefinal

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. More...

#include <async_stream_impl.h>

Public Member Functions

 ServerAsyncReader (::grpc_impl::ServerContext *ctx)
 
void SendInitialMetadata (void *tag) override
 See ServerAsyncStreamingInterface::SendInitialMetadata for semantics. More...
 
void Read (R *msg, void *tag) override
 Read a message of type R into msg. More...
 
void Finish (const W &msg, const ::grpc::Status &status, void *tag) override
 See the ServerAsyncReaderInterface.Read method for semantics. More...
 
void FinishWithError (const ::grpc::Status &status, void *tag) override
 See the ServerAsyncReaderInterface.Read method for semantics. More...
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual ~ServerAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc_impl::internal::AsyncReaderInterface< R >
virtual ~AsyncReaderInterface ()
 

Detailed Description

template<class W, class R>
class grpc_impl::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.

Constructor & Destructor Documentation

◆ ServerAsyncReader()

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

Member Function Documentation

◆ Finish()

template<class W , class R >
void grpc_impl::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_impl::ServerAsyncReaderInterface< W, R >.

◆ FinishWithError()

template<class W , class R >
void grpc_impl::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_impl::ServerAsyncReaderInterface< W, R >.

◆ Read()

template<class W , class R >
void grpc_impl::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_impl::internal::AsyncReaderInterface< R >.

◆ SendInitialMetadata()

template<class W , class R >
void grpc_impl::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.


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