Public Member Functions | List of all members
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>

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

Public Member Functions

bool Write (const W &msg)
 
virtual bool Write (const W &msg, grpc::WriteOptions options)=0
 
void WriteLast (const W &msg, grpc::WriteOptions options)
 
virtual ~WriterInterface ()
 

Detailed Description

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

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

Definition at line 106 of file grpcpp/impl/codegen/sync_stream.h.

Constructor & Destructor Documentation

◆ ~WriterInterface()

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

Definition at line 108 of file grpcpp/impl/codegen/sync_stream.h.

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.

Definition at line 125 of file grpcpp/impl/codegen/sync_stream.h.

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

Definition at line 141 of file grpcpp/impl/codegen/sync_stream.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:33