GRPC C++  1.24.0
Public Member Functions
grpc_impl::ServerAsyncWriter< W > Class Template Referencefinal

Async server-side API for doing server streaming RPCs, where the outgoing message stream from the server has messages of type W. More...

#include <async_stream_impl.h>

Public Member Functions

 ServerAsyncWriter (::grpc_impl::ServerContext *ctx)
 
void SendInitialMetadata (void *tag) override
 See ServerAsyncStreamingInterface::SendInitialMetadata for semantics. More...
 
void Write (const W &msg, void *tag) override
 Request the writing of msg with identifying tag tag. More...
 
void Write (const W &msg, ::grpc::WriteOptions options, void *tag) override
 Request the writing of msg using WriteOptions options with identifying tag tag. More...
 
void WriteAndFinish (const W &msg, ::grpc::WriteOptions options, const ::grpc::Status &status, void *tag) override
 See the ServerAsyncWriterInterface.WriteAndFinish method for semantics. More...
 
void Finish (const ::grpc::Status &status, void *tag) override
 See the ServerAsyncWriterInterface.Finish method for semantics. More...
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual ~ServerAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc_impl::internal::AsyncWriterInterface< W >
virtual ~AsyncWriterInterface ()
 
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::ServerAsyncWriter< W >

Async server-side API for doing server streaming RPCs, where the outgoing message stream from the server has messages of type W.

Constructor & Destructor Documentation

◆ ServerAsyncWriter()

template<class W >
grpc_impl::ServerAsyncWriter< W >::ServerAsyncWriter ( ::grpc_impl::ServerContext ctx)
inlineexplicit

Member Function Documentation

◆ Finish()

template<class W >
void grpc_impl::ServerAsyncWriter< W >::Finish ( const ::grpc::Status status,
void *  tag 
)
inlineoverridevirtual

See the ServerAsyncWriterInterface.Finish method for semantics.

Implicit input parameter:

  • the ServerContext associated with this call is used for sending trailing (and initial if not already sent) metadata to the client.

Note: there are no restrictions are the code of status,it may be non-OK

gRPC doesn't take ownership or a reference to status, so it is safe to to deallocate once Finish returns.

Implements grpc_impl::ServerAsyncWriterInterface< W >.

◆ SendInitialMetadata()

template<class W >
void grpc_impl::ServerAsyncWriter< W >::SendInitialMetadata ( void *  tag)
inlineoverridevirtual

See ServerAsyncStreamingInterface::SendInitialMetadata for semantics.

Implicit input parameter:

  • The initial metadata that will be sent to the client from this op will be taken from the ServerContext associated with the call.
Parameters
[in]tagTag identifying this request.

Implements grpc::internal::ServerAsyncStreamingInterface.

◆ Write() [1/2]

template<class W >
void grpc_impl::ServerAsyncWriter< W >::Write ( const W &  msg,
void *  tag 
)
inlineoverridevirtual

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.

Implements grpc_impl::internal::AsyncWriterInterface< W >.

◆ Write() [2/2]

template<class W >
void grpc_impl::ServerAsyncWriter< W >::Write ( const W &  msg,
::grpc::WriteOptions  options,
void *  tag 
)
inlineoverridevirtual

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.

Implements grpc_impl::internal::AsyncWriterInterface< W >.

◆ WriteAndFinish()

template<class W >
void grpc_impl::ServerAsyncWriter< W >::WriteAndFinish ( const W &  msg,
::grpc::WriteOptions  options,
const ::grpc::Status status,
void *  tag 
)
inlineoverridevirtual

See the ServerAsyncWriterInterface.WriteAndFinish method for semantics.

Implicit input parameter:

  • the ServerContext associated with this call is used for sending trailing (and initial) metadata to the client.

Note: status must have an OK code.

gRPC doesn't take ownership or a reference to msg and status, so it is safe to deallocate once WriteAndFinish returns.

Implements grpc_impl::ServerAsyncWriterInterface< W >.


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