#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 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 |
Public Member Functions inherited from ugrpc::client::CallAnyBase | |
grpc::ClientContext & | GetContext () |
std::string_view | GetClientName () const |
std::string_view | GetCallName () const |
tracing::Span & | GetSpan () |
Additional Inherited Members | |
Protected Member Functions inherited from ugrpc::client::CallAnyBase | |
impl::RpcData & | GetData () |
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 | ) |