GRPC C++  1.66.0
Public Member Functions
grpc::internal::WriterInterface< W > Class Template Referenceabstract

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

#include <sync_stream.h>

Public Member Functions

virtual ~WriterInterface ()
 
virtual bool Write (const W &msg, grpc::WriteOptions options)=0
 Block to write msg to the stream with WriteOptions options. More...
 
bool Write (const W &msg)
 Block to write msg to the stream with default write options. More...
 
void WriteLast (const W &msg, grpc::WriteOptions options)
 Write msg and coalesce it with the writing of trailing metadata, using WriteOptions options. More...
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ ~WriterInterface()

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

Member Function Documentation

◆ Write() [1/2]

template<class W >
bool grpc::internal::WriterInterface< W >::Write ( const W &  msg)
inline

Block to write msg to the stream with default write options.

This is thread-safe with respect to ReaderInterface::Read

Parameters
msgThe message to be written to the stream.
Returns
true on success, false when the stream has been closed.

◆ Write() [2/2]

template<class W >
virtual bool grpc::internal::WriterInterface< W >::Write ( const W &  msg,
grpc::WriteOptions  options 
)
pure virtual

Block to write msg to the stream with WriteOptions options.

This is thread-safe with respect to ReaderInterface::Read

Parameters
msgThe message to be written to the stream.
optionsThe WriteOptions affecting the write operation.
Returns
true on success, false when the stream has been closed.

Implemented in grpc::ServerReaderWriter< W, R >, grpc::ServerSplitStreamer< RequestType, ResponseType >, and grpc::ServerUnaryStreamer< RequestType, ResponseType >.

◆ WriteLast()

template<class W >
void grpc::internal::WriterInterface< W >::WriteLast ( const W &  msg,
grpc::WriteOptions  options 
)
inline

Write msg and coalesce it with the writing of trailing metadata, using WriteOptions options.

For client, WriteLast is equivalent of performing Write and WritesDone in a single step. msg and trailing metadata are coalesced and sent on wire by calling this function. For server, WriteLast buffers the msg. The writing of msg is held until the service handler returns, where msg and trailing metadata are coalesced and sent on wire. 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.

Parameters
[in]msgThe message to be written to the stream.
[in]optionsThe WriteOptions to be used to write this message.

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