#include <userver/ugrpc/client/rpc.hpp>
Controls a single request -> single response RPC.
This class is not thread-safe except for GetContext
.
The RPC is cancelled on destruction unless Finish
or FinishAsync
. In that case the connection is not closed (it will be reused for new RPCs), and the server receives RpcInterruptedError
immediately.
Public Types | |
using | ResponseType = Response |
Public Member Functions | |
Response | Finish () |
Await and read the response. | |
UnaryFuture | FinishAsync (Response &response) |
Asynchronously finish the call. | |
UnaryCall (UnaryCall &&) noexcept=default | |
UnaryCall & | operator= (UnaryCall &&) noexcept=default |
grpc::ClientContext & | GetContext () |
std::string_view | GetClientName () const |
std::string_view | GetCallName () const |
tracing::Span & | GetSpan () |
Protected Member Functions | |
impl::RpcData & | GetData () |
using ugrpc::client::UnaryCall< Response >::ResponseType = Response |
Response ugrpc::client::UnaryCall< Response >::Finish | ( | ) |
Await and read the response.
Finish
should not be called multiple times for the same RPC.
The connection is not closed, it will be reused for new RPCs.
ugrpc::client::RpcError | on an RPC error |
ugrpc::client::RpcCancelledError | on task cancellation |
UnaryFuture ugrpc::client::UnaryCall< Response >::FinishAsync | ( | Response & | response | ) |
|
inherited |
|
inherited |
|
inherited |
ClientContext
used for this RPC
|
inherited |