Public Member Functions | List of all members
grpc::internal::AsyncWriterInterface< W > Class Template Referenceabstract

An interface that can be fed a sequence of messages of type W. More...

#include <async_stream.h>

Inheritance diagram for grpc::internal::AsyncWriterInterface< W >:
Inheritance graph
[legend]

Public Member Functions

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 ()
 

Detailed Description

template<class W>
class grpc::internal::AsyncWriterInterface< W >

An interface that can be fed a sequence of messages of type W.

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

Constructor & Destructor Documentation

◆ ~AsyncWriterInterface()

template<class W >
virtual grpc::internal::AsyncWriterInterface< W >::~AsyncWriterInterface ( )
inlinevirtual

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

Member Function Documentation

◆ Write() [1/2]

template<class W >
virtual void grpc::internal::AsyncWriterInterface< W >::Write ( const W msg,
grpc::WriteOptions  options,
void *  tag 
)
pure virtual

Request the writing of msg using WriteOptions options with identifying tag tag.

Only one write may be outstanding at any given time. This means that after calling Write, one must wait to receive tag from the completion queue BEFORE calling Write again. WriteOptions options is used to set the write options of this message. This is thread-safe with respect to AsyncReaderInterface::Read

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

Parameters
[in]msgThe message to be written.
[in]optionsThe WriteOptions to be used to write this message.
[in]tagThe tag identifying the operation.

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

◆ Write() [2/2]

template<class W >
virtual void grpc::internal::AsyncWriterInterface< W >::Write ( const W msg,
void *  tag 
)
pure virtual

Request the writing of msg with identifying tag tag.

Only one write may be outstanding at any given time. This means that after calling Write, one must wait to receive tag from the completion queue BEFORE calling Write again. This is thread-safe with respect to AsyncReaderInterface::Read

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

Parameters
[in]msgThe message to be written.
[in]tagThe tag identifying the operation.

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

◆ WriteLast()

template<class W >
void grpc::internal::AsyncWriterInterface< W >::WriteLast ( const W msg,
grpc::WriteOptions  options,
void *  tag 
)
inline

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

For client, WriteLast is equivalent of performing Write and WritesDone in a single step. For server, WriteLast buffers the msg. The writing of msg is held until Finish is called, where msg and trailing metadata are coalesced and write is initiated. Note that WriteLast can only buffer msg up to the flow control window size. If msg size is larger than the window size, it will be sent on wire without buffering.

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

Parameters
[in]msgThe message to be written.
[in]optionsThe WriteOptions to be used to write this message.
[in]tagThe tag identifying the operation.

Definition at line 158 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:32