Data structure that holds a set of promises for a single RPC function call; the promises transmit one response (either a value or an exception) for each node that was called. More...
#include <rpc_utils.hpp>
Public Member Functions | |
PendingResults () | |
virtual | ~PendingResults () |
QueryResults< Ret > | get_future () |
Constructs and returns a QueryResults representing the "future" end of the response promises in this PendingResults. More... | |
void | fulfill_map (const node_list_t &who) |
Fill pending_map and reply_promises with one promise/future pair for each node that was contacted in this RPC call. More... | |
void | set_exception_for_caller_removed () |
Sets exceptions to indicate to the sender of this RPC call that it has been removed from its subgroup/shard, and can no longer expect responses. More... | |
void | set_exception_for_removed_node (const node_id_t &removed_nid) |
void | set_value (const node_id_t &nid, const Ret &v) |
Fulfills a promise for a single node's reply by setting the value that the node returned for the RPC call. More... | |
void | set_exception (const node_id_t &nid, const std::exception_ptr e) |
Fulfills a promise for a single node's reply by setting an exception that was thrown by the RPC function call. More... | |
bool | all_responded () const |
void | reset () |
reset this object. More... | |
Public Member Functions inherited from derecho::rpc::PendingBase | |
virtual | ~PendingBase () |
Private Attributes | |
std::promise< std::unique_ptr< reply_map< Ret > > > | promise_for_pending_map |
A promise for a map containing one future for each reply to the RPC function call. More... | |
std::promise< std::map< node_id_t, std::promise< Ret > > > | promise_for_reply_promises |
std::future< std::map< node_id_t, std::promise< Ret > > > | reply_promises_are_ready |
A future for a map containing one promise for each reply to the RPC function call. More... | |
std::mutex | reply_promises_are_ready_mutex |
std::map< node_id_t, std::promise< Ret > > | reply_promises |
bool | map_fulfilled = false |
std::set< node_id_t > | dest_nodes |
std::set< node_id_t > | responded_nodes |
Data structure that holds a set of promises for a single RPC function call; the promises transmit one response (either a value or an exception) for each node that was called.
The future ends of these promises are stored in a corresponding QueryResults object.
Ret | The return type of the RPC function, which is the type of a response's value. |
Definition at line 353 of file rpc_utils.hpp.
|
inline |
Definition at line 372 of file rpc_utils.hpp.
|
inlinevirtual |
Definition at line 374 of file rpc_utils.hpp.
|
inlinevirtual |
Implements derecho::rpc::PendingBase.
Definition at line 472 of file rpc_utils.hpp.
|
inlinevirtual |
Fill pending_map and reply_promises with one promise/future pair for each node that was contacted in this RPC call.
who | A list of nodes from which to expect responses. |
Implements derecho::rpc::PendingBase.
Definition at line 390 of file rpc_utils.hpp.
|
inline |
Constructs and returns a QueryResults representing the "future" end of the response promises in this PendingResults.
Definition at line 381 of file rpc_utils.hpp.
|
inlinevirtual |
reset this object.
Implements derecho::rpc::PendingBase.
Definition at line 479 of file rpc_utils.hpp.
|
inline |
Fulfills a promise for a single node's reply by setting an exception that was thrown by the RPC function call.
nid | The node that responded to the RPC call with an exception |
e | The exception_ptr that the RPC function call returned |
Definition at line 460 of file rpc_utils.hpp.
|
inlinevirtual |
Sets exceptions to indicate to the sender of this RPC call that it has been removed from its subgroup/shard, and can no longer expect responses.
Implements derecho::rpc::PendingBase.
Definition at line 408 of file rpc_utils.hpp.
|
inlinevirtual |
Implements derecho::rpc::PendingBase.
Definition at line 427 of file rpc_utils.hpp.
|
inline |
Fulfills a promise for a single node's reply by setting the value that the node returned for the RPC call.
nid | The node that responded to the RPC call |
v | The value that it returned as the result of the RPC function |
Definition at line 443 of file rpc_utils.hpp.
|
private |
Definition at line 369 of file rpc_utils.hpp.
|
private |
Definition at line 368 of file rpc_utils.hpp.
|
private |
A promise for a map containing one future for each reply to the RPC function call.
The future end of this promise lives in QueryResults, and is fulfilled when the RPC function call is actually sent and the set of repliers is known.
Definition at line 358 of file rpc_utils.hpp.
|
private |
Definition at line 360 of file rpc_utils.hpp.
|
private |
Definition at line 366 of file rpc_utils.hpp.
|
private |
A future for a map containing one promise for each reply to the RPC function call.
It will be fulfilled when fulfill_map is called, which means the RPC function call was actually sent and the set of destination nodes is known.
Definition at line 364 of file rpc_utils.hpp.
|
private |
Definition at line 365 of file rpc_utils.hpp.
|
private |
Definition at line 369 of file rpc_utils.hpp.