template<typename Request, typename Response>
class ugrpc::client::OutputStream< Request, Response >
Controls a request stream -> single response RPC.
This class is not thread-safe except for GetContext
.
The RPC is cancelled on destruction unless Finish
has been called. In that case the connection is not closed (it will be reused for new RPCs), and the server receives RpcInterruptedError
immediately.
Definition at line 252 of file rpc.hpp.
template<typename Request, typename Response>
Complete the RPC successfully.
Should be called once all the data is written. The server will then send a single Response
.
Finish
should not be called multiple times.
The connection is not closed, it will be reused for new RPCs.
- Returns
- the single
Response
received after finishing the writes
- Exceptions
-
Definition at line 641 of file rpc.hpp.
template<typename Request, typename Response>
Write the next outgoing message.
Write
doesn't store any references to request
, so it can be deallocated right after the call.
- Parameters
-
request | the next message to write |
- Returns
- true if the data is going to the wire; false if the write operation failed (including due to task cancellation, in which case no more writes will be accepted, and the error details can be fetched from Finish
Definition at line 606 of file rpc.hpp.
template<typename Request, typename Response>
Write the next outgoing message and check result.
WriteAndCheck
doesn't store any references to request
, so it can be deallocated right after the call.
WriteAndCheck
verifies result of the write and generates exception in case of issues.
- Parameters
-
request | the next message to write |
- Exceptions
-
Definition at line 622 of file rpc.hpp.