Public Member Functions | List of all members
grpc::ServerAsyncReaderWriterInterface< W, R > Class Template Referenceabstract

Server-side interface for asynchronous bi-directional streaming. More...

#include <async_stream.h>

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

Public Member Functions

virtual void Finish (const grpc::Status &status, void *tag)=0
 
virtual void WriteAndFinish (const W &msg, grpc::WriteOptions options, const grpc::Status &status, void *tag)=0
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual void SendInitialMetadata (void *tag)=0
 
virtual ~ServerAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc::internal::AsyncWriterInterface< W >
virtual void Write (const W &msg, grpc::WriteOptions options, void *tag)=0
 
virtual void Write (const W &msg, void *tag)=0
 
void WriteLast (const W &msg, grpc::WriteOptions options, void *tag)
 
virtual ~AsyncWriterInterface ()
 
- Public Member Functions inherited from grpc::internal::AsyncReaderInterface< R >
virtual void Read (R *msg, void *tag)=0
 
virtual ~AsyncReaderInterface ()
 

Detailed Description

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

Server-side interface for asynchronous bi-directional streaming.

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

Member Function Documentation

◆ Finish()

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

Indicate that the stream is to be finished with a certain 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.

It is appropriate to call this method when either:

  • all messages from the client have been received (either known implictly, 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'.
  • it is desired to end the call early with some non-OK status code.

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 status, so it is safe to to deallocate once Finish returns.

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

Implemented in grpc::ServerAsyncReaderWriter< W, R >, grpc::ServerAsyncReaderWriter< ResponseType, RequestType >, and grpc::ServerAsyncReaderWriter< grpc::lb::v1::LoadReportResponse, grpc::lb::v1::LoadReportRequest >.

◆ WriteAndFinish()

template<class W , class R >
virtual void grpc::ServerAsyncReaderWriterInterface< W, R >::WriteAndFinish ( const W msg,
grpc::WriteOptions  options,
const grpc::Status status,
void *  tag 
)
pure virtual

Request the writing of msg and coalesce it with trailing metadata which contains status, using WriteOptions options with identifying tag tag.

WriteAndFinish is equivalent of performing WriteLast and Finish in a single step.

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

Parameters
[in]msgThe message to be written.
[in]optionsThe WriteOptions to be used to write this message.
[in]statusThe Status that server returns to client.
[in]tagThe tag identifying the operation.

Implemented in grpc::ServerAsyncReaderWriter< W, R >, grpc::ServerAsyncReaderWriter< ResponseType, RequestType >, and grpc::ServerAsyncReaderWriter< grpc::lb::v1::LoadReportResponse, grpc::lb::v1::LoadReportRequest >.


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


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