cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::clients::impl::CallPromise Class Reference

Class to set results of RPCs. More...

#include <msgpack_rpc/clients/impl/call_promise.h.h>

Collaboration diagram for msgpack_rpc::clients::impl::CallPromise:

Public Member Functions

 CallPromise (std::chrono::steady_clock::time_point deadline)
 Constructor.
std::shared_ptr< CallFutureImplfuture () const noexcept
 Get the future.
void set (const Status &error)
 Set an error.
void set (messages::CallResult result)
 Set a result.

Private Attributes

std::shared_ptr< CallFutureImplfuture_
 Future.

Detailed Description

Class to set results of RPCs.

Definition at line 35 of file call_promise.h.h.

Constructor & Destructor Documentation

◆ CallPromise()

msgpack_rpc::clients::impl::CallPromise::CallPromise ( std::chrono::steady_clock::time_point deadline)
inlineexplicit

Constructor.

Parameters
[in]deadlineDeadline of the result of the RPC.

Definition at line 42 of file call_promise.h.h.

Member Function Documentation

◆ future()

std::shared_ptr< CallFutureImpl > msgpack_rpc::clients::impl::CallPromise::future ( ) const
inlinenodiscardnoexcept

Get the future.

Returns
Future.

Definition at line 64 of file call_promise.h.h.

◆ set() [1/2]

void msgpack_rpc::clients::impl::CallPromise::set ( const Status & error)
inline

Set an error.

Parameters
[in]errorError.

Definition at line 57 of file call_promise.h.h.

◆ set() [2/2]

void msgpack_rpc::clients::impl::CallPromise::set ( messages::CallResult result)
inline

Set a result.

Parameters
[in]resultResult.

Definition at line 50 of file call_promise.h.h.

Member Data Documentation

◆ future_

std::shared_ptr<CallFutureImpl> msgpack_rpc::clients::impl::CallPromise::future_
private

Future.

Definition at line 70 of file call_promise.h.h.


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