template<typename Request, typename Response>
class ugrpc::client::BidirectionalStream< Request, Response >
Controls a request stream -> response stream RPC.
This class allows the following concurrent calls:
GetContext
- Concurrent call of one of (
Read
, ReadAsync
) with one of (Write
, WritesDone
) WriteAndCheck
is not thread-safe
The RPC is cancelled on destruction unless the stream is closed (Read
has returned false
). In that case the connection is not closed (it will be reused for new RPCs), and the server receives RpcInterruptedError
immediately. gRPC provides no way to early-close a server-streaming RPC gracefully.
Read
and AsyncRead
can throw if error status is received from server. User MUST NOT call Read
or AsyncRead
again after failure of any of these operations.
Write
and WritesDone
methods do not throw, but indicate issues with the RPC by returning false
.
WriteAndCheck
is intended for ping-pong scenarios, when after write operation the user calls Read
and vice versa.
If Write
or WritesDone
returns negative result, the user MUST NOT call any of these methods anymore. Instead the user SHOULD call Read
method until the end of input. If Write
or WritesDone
finishes with negative result, finally Read
will throw an exception.
Definition at line 321 of file rpc.hpp.