Google Cloud C++ Client
2.7.0
C++ Client Library for Google Cloud Platform
|
A streaming read-write RPC. More...
#include <google/cloud/async_streaming_read_write_rpc.h>
Public Member Functions | |
virtual | ~AsyncStreamingReadWriteRpc ()=default |
virtual void | Cancel ()=0 |
Sends a best-effort request to cancel the RPC. More... | |
virtual future< bool > | Start ()=0 |
Start the streaming RPC. More... | |
virtual future< absl::optional< Response > > | Read ()=0 |
Read one response from the streaming RPC. More... | |
virtual future< bool > | Write (Request const &, grpc::WriteOptions)=0 |
Write one request to the streaming RPC. More... | |
virtual future< bool > | WritesDone ()=0 |
Half-closes the streaming RPC. More... | |
virtual future< Status > | Finish ()=0 |
Return the final status of the streaming RPC. More... | |
A streaming read-write RPC.
Streaming read-write RPCs (sometimes called bidirectional streaming RPCs) allow applications to send multiple "requests" and receive multiple "responses" on the same request. They are often used in services where sending one request at a time introduces too much latency. The requests
Definition at line 37 of file async_streaming_read_write_rpc.h.
|
virtualdefault |
|
pure virtual |
|
pure virtual |
Return the final status of the streaming RPC.
Streaming RPCs may return an error because the stream is closed, independently of any whether the application has called WritesDone()
or signaled that the stream is closed using other mechanisms (some RPCs define specific attributes to "close" the stream).
The application must wait until all pending Read()
and Write()
operations have completed before calling Finish()
.
|
pure virtual |
Read one response from the streaming RPC.
Read()
operation may be pending at a time. The application is responsible for waiting until any previous Read()
operations have completed before calling Read()
again.Whether Read()
can be called before a Write()
operation is specified by each service and RPC. Most services require at least one Write()
call before calling Read()
. Many services may return more than one response for a single Write()
request. Each service and RPC specifies how to discover if more responses will be forthcoming.
If the optional<>
is not engaged the streaming RPC has completed. The application should wait until any other pending operations (typically any other Write()
calls) complete and then call Finish()
to find the status of the streaming RPC.
|
pure virtual |
Start the streaming RPC.
Applications should call Start()
and wait for its result before calling Read()
and/or Write()
. If Start()
completes with false
the stream has completed with an error. The application should not call Read()
or Write()
in this case. On errors, the application should callFinish()
to determine the status of the streaming RPC.
|
pure virtual |
Write one request to the streaming RPC.
Write()
operation may be pending at a time. The application is responsible for waiting until any previous Write()
operations have completed before calling Write()
again.Whether Write()
can be called before waiting for a matching Read()
operation is specified by each service and RPC. Many services tolerate multiple Write()
calls before performing or at least receiving a Read()
response.
If Write()
completes with false
the streaming RPC has completed. The application should wait until any other pending operations (typically any other Read()
calls) complete and then call Finish()
to find the status of the streaming RPC.
|
pure virtual |
Half-closes the streaming RPC.
Sends an indication to the service that no more requests will be issued by the client.
If WritesDone()
completes with false
the streaming RPC has completed. The application should wait until any other pending operations (typically any other Read()
calls) complete and then call Finish()
to find the status of the streaming RPC.