GRPC C++  0.11.0.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions
grpc::ClientReader< R > Class Template Reference

#include <channel.h>

Public Member Functions

template<class W >
 ClientReader (Channel *channel, const RpcMethod &method, ClientContext *context, const W &request)
 Blocking create a stream and write the first request out. More...
 
void WaitForInitialMetadata ()
 Blocking wait for initial metadata from server. More...
 
bool Read (R *msg) GRPC_OVERRIDE
 Blocking read a message and parse to msg. More...
 
Status Finish () GRPC_OVERRIDE
 Wait until the stream finishes, and return the final status. More...
 
- Public Member Functions inherited from grpc::ClientStreamingInterface
virtual ~ClientStreamingInterface ()
 
- Public Member Functions inherited from grpc::ReaderInterface< R >
virtual ~ReaderInterface ()
 

Constructor & Destructor Documentation

template<class R >
template<class W >
grpc::ClientReader< R >::ClientReader ( Channel channel,
const RpcMethod method,
ClientContext context,
const W &  request 
)
inline

Blocking create a stream and write the first request out.

Member Function Documentation

template<class R >
Status grpc::ClientReader< R >::Finish ( )
inlinevirtual

Wait until the stream finishes, and return the final status.

When the client side declares it has no more message to send, either implicitly or by calling WritesDone(), it needs to make sure there is no more message to be received from the server, either implicitly or by getting a false from a Read().

This function will return either:

  • when all incoming messages have been read and the server has returned status.
  • OR when the server has returned a non-OK status.

Implements grpc::ClientStreamingInterface.

template<class R >
bool grpc::ClientReader< R >::Read ( R *  msg)
inlinevirtual

Blocking read a message and parse to msg.

Returns true on success.

Parameters
[out]msgThe read message.
Returns
false when there will be no more incoming messages, either because the other side has called WritesDone() or the stream has failed (or been cancelled).

Implements grpc::ReaderInterface< R >.

template<class R >
void grpc::ClientReader< R >::WaitForInitialMetadata ( )
inlinevirtual

Blocking wait for initial metadata from server.

The received metadata can only be accessed after this call returns. Should only be called before the first read. Calling this method is optional, and if it is not called the metadata will be available in ClientContext after the first read.

status ignored

Implements grpc::ClientReaderInterface< R >.


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