userver: ugrpc::client::UnaryFuture Class Reference
Loading...
Searching...
No Matches
ugrpc::client::UnaryFuture Class Reference

#include <userver/ugrpc/client/rpc.hpp>

Detailed Description

UnaryFuture for waiting a single response RPC.

Definition at line 33 of file rpc.hpp.

Public Member Functions

 UnaryFuture (UnaryFuture &&) noexcept=default
 
UnaryFutureoperator= (UnaryFuture &&) noexcept
 
 UnaryFuture (const UnaryFuture &)=delete
 
UnaryFutureoperator= (const UnaryFuture &)=delete
 
void Get ()
 Await response.
 
engine::FutureStatus Get (engine::Deadline deadline)
 Await response until specified timepoint.
 
bool IsReady () const noexcept
 Checks if the asynchronous call has completed Note, that once user gets result, IsReady should not be called.
 

Member Function Documentation

◆ Get() [1/2]

void ugrpc::client::UnaryFuture::Get ( )

Await response.

Upon completion result is available in response when initiating the asynchronous operation, e.g. FinishAsync.

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

Exceptions
ugrpc::client::RpcErroron an RPC error
ugrpc::client::RpcCancelledErroron task cancellation

◆ Get() [2/2]

engine::FutureStatus ugrpc::client::UnaryFuture::Get ( engine::Deadline deadline)

Await response until specified timepoint.

Once kReady is returned, result is available in response when initiating the asynchronous operation, e.g. FinishAsync.

In case of 'kReady/kCancelled' answer or exception Get should not be called anymore.

Exceptions
ugrpc::client::RpcErroron an RPC error

◆ IsReady()

bool ugrpc::client::UnaryFuture::IsReady ( ) const
noexcept

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

Returns
true if result ready

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