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

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

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

Member Function Documentation

◆ Write() [1/2]

template<class W>
bool grpc_impl::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_impl::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_impl::ServerReaderWriter< W, R >, grpc_impl::ServerWriter< W >, grpc_impl::ClientReaderWriter< W, R >, grpc_impl::ClientWriter< W >, grpc_impl::ServerSplitStreamer< RequestType, ResponseType >, and grpc_impl::ServerUnaryStreamer< RequestType, ResponseType >.

◆ WriteLast()

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