#include <userver/ugrpc/client/stream.hpp>
Client-side interface for server-streaming.
This class is not thread-safe except for GetContext
.
The RPC should be completed by reading until ugrpc::client::Reader::Read returns false
. If destroyed early, the RPC is cancelled. The server gets ugrpc::client::RpcInterruptedError and the abandoned-error
metric is incremented. The connection stays open for reuse. gRPC provides no way to early-close a server-streaming RPC gracefully. See ugrpc::client::ReadRemainingAndFinish for graceful completion.
Definition at line 24 of file stream.hpp.
Public Member Functions | |
Reader (Reader &&) noexcept=default | |
Reader & | operator= (Reader &&) noexcept=default |
bool | Read (Response &response) |
Await and read the next incoming message. | |
CallContext & | GetContext () |
Get call context, useful e.g. for accessing metadata. | |
const CallContext & | GetContext () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
inline |
Get call context, useful e.g. for accessing metadata.
Definition at line 53 of file stream.hpp.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 55 of file stream.hpp.
|
inline |
Await and read the next incoming message.
On end-of-input, Finish
is called automatically.
response | where to put response on success |
true
on success, false
on end-of-input, task cancellation, ugrpc::client::RpcError | on an RPC error |
Definition at line 50 of file stream.hpp.