Public Member Functions | Private Member Functions | Private Attributes | List of all members
grpc::ServerAsyncWriter< W > Class Template Referencefinal

#include <async_stream.h>

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

Public Member Functions

void Finish (const grpc::Status &status, void *tag) override
 
void SendInitialMetadata (void *tag) override
 
 ServerAsyncWriter (grpc::ServerContext *ctx)
 
void Write (const W &msg, grpc::WriteOptions options, void *tag) override
 
void Write (const W &msg, void *tag) override
 
void WriteAndFinish (const W &msg, grpc::WriteOptions options, const grpc::Status &status, void *tag) override
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual ~ServerAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc::internal::AsyncWriterInterface< W >
void WriteLast (const W &msg, grpc::WriteOptions options, void *tag)
 
virtual ~AsyncWriterInterface ()
 

Private Member Functions

void BindCall (grpc::internal::Call *call) override
 
template<class T >
void EnsureInitialMetadataSent (T *ops)
 

Private Attributes

grpc::internal::Call call_
 
grpc::ServerContextctx_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpServerSendStatusfinish_ops_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadatameta_ops_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpServerSendStatuswrite_ops_
 

Detailed Description

template<class W>
class grpc::ServerAsyncWriter< W >

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

Definition at line 845 of file grpcpp/impl/codegen/async_stream.h.

Constructor & Destructor Documentation

◆ ServerAsyncWriter()

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

Definition at line 847 of file grpcpp/impl/codegen/async_stream.h.

Member Function Documentation

◆ BindCall()

template<class W >
void grpc::ServerAsyncWriter< W >::BindCall ( grpc::internal::Call call)
inlineoverrideprivatevirtual

◆ EnsureInitialMetadataSent()

template<class W >
template<class T >
void grpc::ServerAsyncWriter< W >::EnsureInitialMetadataSent ( T ops)
inlineprivate

Definition at line 932 of file grpcpp/impl/codegen/async_stream.h.

◆ Finish()

template<class W >
void grpc::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::ServerAsyncWriterInterface< W >.

Definition at line 921 of file grpcpp/impl/codegen/async_stream.h.

◆ SendInitialMetadata()

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

Definition at line 857 of file grpcpp/impl/codegen/async_stream.h.

◆ Write() [1/2]

template<class W >
void grpc::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::internal::AsyncWriterInterface< W >.

Definition at line 878 of file grpcpp/impl/codegen/async_stream.h.

◆ Write() [2/2]

template<class W >
void grpc::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::internal::AsyncWriterInterface< W >.

Definition at line 870 of file grpcpp/impl/codegen/async_stream.h.

◆ WriteAndFinish()

template<class W >
void grpc::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::ServerAsyncWriterInterface< W >.

Definition at line 900 of file grpcpp/impl/codegen/async_stream.h.

Member Data Documentation

◆ call_

template<class W >
grpc::internal::Call grpc::ServerAsyncWriter< W >::call_
private

Definition at line 943 of file grpcpp/impl/codegen/async_stream.h.

◆ ctx_

template<class W >
grpc::ServerContext* grpc::ServerAsyncWriter< W >::ctx_
private

Definition at line 944 of file grpcpp/impl/codegen/async_stream.h.

◆ finish_ops_

Definition at line 953 of file grpcpp/impl/codegen/async_stream.h.

◆ meta_ops_

Definition at line 946 of file grpcpp/impl/codegen/async_stream.h.

◆ write_ops_

Definition at line 950 of file grpcpp/impl/codegen/async_stream.h.


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


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