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

#include <async_stream.h>

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

Public Member Functions

void Finish (grpc::Status *status, void *tag) override
 
void ReadInitialMetadata (void *tag) override
 
void StartCall (void *tag) override
 
void Write (const W &msg, grpc::WriteOptions options, void *tag) override
 
void Write (const W &msg, void *tag) override
 
void WritesDone (void *tag) override
 
- Public Member Functions inherited from grpc::internal::ClientAsyncStreamingInterface
virtual ~ClientAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc::internal::AsyncWriterInterface< W >
void WriteLast (const W &msg, grpc::WriteOptions options, void *tag)
 
virtual ~AsyncWriterInterface ()
 

Static Public Member Functions

static void operator delete (void *, std::size_t size)
 
static void operator delete (void *, void *)
 

Private Member Functions

template<class R >
 ClientAsyncWriter (grpc::internal::Call call, grpc::ClientContext *context, R *response, bool start, void *tag)
 
void StartCallInternal (void *tag)
 

Private Attributes

grpc::internal::Call call_
 
grpc::ClientContextcontext_
 
grpc::internal::CallOpSet< grpc::internal::CallOpRecvInitialMetadata, grpc::internal::CallOpGenericRecvMessage, grpc::internal::CallOpClientRecvStatusfinish_ops_
 
grpc::internal::CallOpSet< grpc::internal::CallOpRecvInitialMetadatameta_ops_
 
bool started_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpClientSendClosewrite_ops_
 

Friends

class internal::ClientAsyncWriterFactory< W >
 

Detailed Description

template<class W>
class grpc::ClientAsyncWriter< W >

Async API on the client side for doing client-streaming RPCs, where the outgoing message stream going to the server contains messages of type W.

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

Constructor & Destructor Documentation

◆ ClientAsyncWriter()

template<class W >
template<class R >
grpc::ClientAsyncWriter< W >::ClientAsyncWriter ( grpc::internal::Call  call,
grpc::ClientContext context,
R *  response,
bool  start,
void *  tag 
)
inlineprivate

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

Member Function Documentation

◆ Finish()

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

See the ClientAsyncStreamingInterface.Finish method for semantics.

Side effect:

  • the ClientContext associated with this call is updated with possible initial and trailing metadata received from the server.
  • attempts to fill in the response parameter passed to this class's constructor with the server's response message.

Implements grpc::internal::ClientAsyncStreamingInterface.

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

◆ operator delete() [1/2]

template<class W >
static void grpc::ClientAsyncWriter< W >::operator delete ( void *  ,
std::size_t  size 
)
inlinestatic

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

◆ operator delete() [2/2]

template<class W >
static void grpc::ClientAsyncWriter< W >::operator delete ( void *  ,
void *   
)
inlinestatic

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

◆ ReadInitialMetadata()

template<class W >
void grpc::ClientAsyncWriter< W >::ReadInitialMetadata ( void *  tag)
inlineoverridevirtual

See the ClientAsyncStreamingInterface.ReadInitialMetadata method for semantics.

Side effect:

  • upon receiving initial metadata from the server, the ClientContext associated with this call is updated, and the calling code can access the received metadata through the ClientContext.

Implements grpc::internal::ClientAsyncStreamingInterface.

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

◆ StartCall()

template<class W >
void grpc::ClientAsyncWriter< W >::StartCall ( void *  tag)
inlineoverridevirtual

Start the call that was set up by the constructor, but only if the constructor was invoked through the "Prepare" API which doesn't actually start the call

Implements grpc::internal::ClientAsyncStreamingInterface.

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

◆ StartCallInternal()

template<class W >
void grpc::ClientAsyncWriter< W >::StartCallInternal ( void *  tag)
inlineprivate

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

◆ Write() [1/2]

template<class W >
void grpc::ClientAsyncWriter< 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 391 of file grpcpp/impl/codegen/async_stream.h.

◆ Write() [2/2]

template<class W >
void grpc::ClientAsyncWriter< 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 383 of file grpcpp/impl/codegen/async_stream.h.

◆ WritesDone()

template<class W >
void grpc::ClientAsyncWriter< W >::WritesDone ( void *  tag)
inlineoverridevirtual

Signal the client is done with the writes (half-close the client stream). Thread-safe with respect to AsyncReaderInterface::Read

Parameters
[in]tagThe tag identifying the operation.

Implements grpc::ClientAsyncWriterInterface< W >.

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

Friends And Related Function Documentation

◆ internal::ClientAsyncWriterFactory< W >

template<class W >
friend class internal::ClientAsyncWriterFactory< W >
friend

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

Member Data Documentation

◆ call_

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

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

◆ context_

template<class W >
grpc::ClientContext* grpc::ClientAsyncWriter< W >::context_
private

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

◆ finish_ops_

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

◆ meta_ops_

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

◆ started_

template<class W >
bool grpc::ClientAsyncWriter< W >::started_
private

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

◆ write_ops_

Definition at line 461 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:30