GRPC C++  1.46.2
Public Member Functions | Static Public Member Functions | Friends
grpc::ClientAsyncWriter< W > Class Template Referencefinal

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

#include <async_stream.h>

Public Member Functions

void StartCall (void *tag) override
 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. More...
 
void ReadInitialMetadata (void *tag) override
 See the ClientAsyncStreamingInterface.ReadInitialMetadata method 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 WritesDone (void *tag) override
 Signal the client is done with the writes (half-close the client stream). More...
 
void Finish (grpc::Status *status, void *tag) override
 See the ClientAsyncStreamingInterface.Finish method for semantics. More...
 
- Public Member Functions inherited from grpc::internal::ClientAsyncStreamingInterface
virtual ~ClientAsyncStreamingInterface ()
 
- Public Member Functions inherited from grpc::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...
 

Static Public Member Functions

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

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.

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.

◆ operator delete() [1/2]

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

◆ operator delete() [2/2]

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

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

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

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

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

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

Friends And Related Function Documentation

◆ internal::ClientAsyncWriterFactory< W >

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

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