GRPC C++  1.66.0
Public Member Functions
grpc::ServerAsyncReaderInterface< W, R > Class Template Referenceabstract

#include <async_stream.h>

Public Member Functions

virtual void Finish (const W &msg, const grpc::Status &status, void *tag)=0
 Indicate that the stream is to be finished with a certain status code and also send out msg response to the client. More...
 
virtual void FinishWithError (const grpc::Status &status, void *tag)=0
 Indicate that the stream is to be finished with a certain non-OK status code. More...
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual ~ServerAsyncStreamingInterface ()
 
virtual void SendInitialMetadata (void *tag)=0
 Request notification of the sending of initial metadata to the client. More...
 
- Public Member Functions inherited from grpc::internal::AsyncReaderInterface< R >
virtual ~AsyncReaderInterface ()
 
virtual void Read (R *msg, void *tag)=0
 Read a message of type R into msg. More...
 

Member Function Documentation

◆ Finish()

template<class W , class R >
virtual void grpc::ServerAsyncReaderInterface< W, R >::Finish ( const W &  msg,
const grpc::Status status,
void *  tag 
)
pure virtual

Indicate that the stream is to be finished with a certain status code and also send out msg response to the client.

Request notification for when the server has sent the response and the appropriate signals to the client to end the call. Should not be used concurrently with other operations.

It is appropriate to call this method when:

  • all messages from the client have been received (either known implicitly, or explicitly because a previous AsyncReaderInterface::Read operation with a non-ok result, e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false').

This operation will end when the server has finished sending out initial metadata (if not sent already), response message, and status, or if some failure occurred when trying to do so.

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

Parameters
[in]tagTag identifying this request.
[in]statusTo be sent to the client as the result of this call.
[in]msgTo be sent to the client as the response for this call.

◆ FinishWithError()

template<class W , class R >
virtual void grpc::ServerAsyncReaderInterface< W, R >::FinishWithError ( const grpc::Status status,
void *  tag 
)
pure virtual

Indicate that the stream is to be finished with a certain non-OK status code.

Request notification for when the server has sent the appropriate signals to the client to end the call. Should not be used concurrently with other operations.

This call is meant to end the call with some error, and can be called at any point that the server would like to "fail" the call (though note this shouldn't be called concurrently with any other "sending" call, like AsyncWriterInterface::Write).

This operation will end when the server has finished sending out initial metadata (if not sent already), and status, or if some failure occurred when trying to do so.

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

Parameters
[in]tagTag identifying this request.
[in]statusTo be sent to the client as the result of this call.
  • Note: status must have a non-OK code.

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