userver: grpc_proto_structs::client::ResponseFuture< Response > Class Template Reference
Loading...
Searching...
No Matches
grpc_proto_structs::client::ResponseFuture< Response > Class Template Referencefinal

#include </data/code/userver/libraries/grpc-proto-structs/include/userver/grpc-proto-structs/client/response_future.hpp>

Detailed Description

template<typename Response>
class grpc_proto_structs::client::ResponseFuture< Response >

proto-struct response future.

Definition at line 16 of file response_future.hpp.

Public Types

using VanillaResponse = proto_structs::traits::CompatibleMessageType<Response>
 
using VanillaFuture = ugrpc::client::ResponseFuture<VanillaResponse>
 

Public Member Functions

 ResponseFuture (VanillaFuture &&future)
 
bool IsReady () const
 Checks if the asynchronous call has completed. Note, that once user gets result, IsReady should not be called.
 
engine::FutureStatus WaitUntil (engine::Deadline deadline) const noexcept
 Await response until specified timepoint.
 
Response Get ()
 Await and read the response.
 
void Cancel ()
 Cancel call.
 
ugrpc::client::CallContextGetContext ()
 Get call context, useful e.g. for accessing metadata.
 
const ugrpc::client::CallContextGetContext () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Member Typedef Documentation

◆ VanillaFuture

template<typename Response>
using grpc_proto_structs::client::ResponseFuture< Response >::VanillaFuture = ugrpc::client::ResponseFuture<VanillaResponse>

Definition at line 19 of file response_future.hpp.

◆ VanillaResponse

template<typename Response>
using grpc_proto_structs::client::ResponseFuture< Response >::VanillaResponse = proto_structs::traits::CompatibleMessageType<Response>

Definition at line 18 of file response_future.hpp.

Constructor & Destructor Documentation

◆ ResponseFuture()

template<typename Response>
grpc_proto_structs::client::ResponseFuture< Response >::ResponseFuture ( VanillaFuture && future)
inlineexplicit

Definition at line 21 of file response_future.hpp.

Member Function Documentation

◆ Cancel()

template<typename Response>
void grpc_proto_structs::client::ResponseFuture< Response >::Cancel ( )
inline

Cancel call.

Definition at line 50 of file response_future.hpp.

◆ Get()

template<typename Response>
Response grpc_proto_structs::client::ResponseFuture< Response >::Get ( )
inline

Await and read the response.

Get should not be called multiple times for the same UnaryFuture.

The connection is not closed, it will be reused for new RPCs.

Returns
the response on success.
Exceptions
ugrpc::client::RpcErroron an RPC error.
ugrpc::client::RpcCancelledErroron task cancellation.

Definition at line 44 of file response_future.hpp.

◆ GetContext() [1/2]

template<typename Response>
ugrpc::client::CallContext & grpc_proto_structs::client::ResponseFuture< Response >::GetContext ( )
inline

Get call context, useful e.g. for accessing metadata.

Definition at line 53 of file response_future.hpp.

◆ GetContext() [2/2]

template<typename Response>
const ugrpc::client::CallContext & grpc_proto_structs::client::ResponseFuture< Response >::GetContext ( ) const
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 56 of file response_future.hpp.

◆ IsReady()

template<typename Response>
bool grpc_proto_structs::client::ResponseFuture< Response >::IsReady ( ) const
inlinenodiscard

Checks if the asynchronous call has completed. Note, that once user gets result, IsReady should not be called.

Returns
true if result ready.

Definition at line 26 of file response_future.hpp.

◆ WaitUntil()

template<typename Response>
engine::FutureStatus grpc_proto_structs::client::ResponseFuture< Response >::WaitUntil ( engine::Deadline deadline) const
inlinenodiscardnoexcept

Await response until specified timepoint.

Exceptions
ugrpc::client::RpcErroron an RPC error.

Definition at line 31 of file response_future.hpp.


The documentation for this class was generated from the following file: