GRPC C++  1.30.0
Public Member Functions
grpc_impl::internal::AsyncWriterInterface< W > Class Template Referenceabstract

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

#include <async_stream_impl.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_impl::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_impl::internal::AsyncWriterInterface< W >::~AsyncWriterInterface ( )
inlinevirtual

Member Function Documentation

◆ Write() [1/2]

template<class W >
virtual void grpc_impl::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_impl::ServerAsyncReaderWriter< W, R >, grpc_impl::ServerAsyncWriter< W >, grpc_impl::ClientAsyncReaderWriter< W, R >, and grpc_impl::ClientAsyncWriter< W >.

◆ Write() [2/2]

template<class W >
virtual void grpc_impl::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_impl::ServerAsyncReaderWriter< W, R >, grpc_impl::ServerAsyncWriter< W >, grpc_impl::ClientAsyncReaderWriter< W, R >, and grpc_impl::ClientAsyncWriter< W >.

◆ WriteLast()

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