GRPC C++  1.66.0
Public Member Functions
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>

Public Member Functions

virtual ~AsyncWriterInterface ()
 
virtual void Write (const W &msg, void *tag)=0
 Request the writing of msg with identifying tag tag. More...
 
virtual void Write (const W &msg, grpc::WriteOptions options, void *tag)=0
 Request the writing of msg using WriteOptions options with identifying tag tag. More...
 
void WriteLast (const W &msg, grpc::WriteOptions options, void *tag)
 Request the writing of msg and coalesce it with the writing of trailing metadata, using WriteOptions options with identifying tag tag. More...
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ ~AsyncWriterInterface()

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

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.

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

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

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