Data structure that (indirectly) holds a set of futures for a single RPC function call; there is one future for each node contacted to make the call, and it will eventually contain that node's reply. More...
#include <rpc_utils.hpp>
Classes | |
class | ReplyMap |
Public Types | |
using | map_fut = std::future< std::unique_ptr< reply_map< Ret > >> |
using | map = reply_map< Ret > |
using | type = Ret |
Public Member Functions | |
QueryResults (map_fut pm) | |
QueryResults (QueryResults &&o) | |
QueryResults (const QueryResults &)=delete | |
template<typename Time > | |
ReplyMap * | wait (Time t) |
Wait the specified duration; if a ReplyMap is available after that duration, return it. More... | |
ReplyMap & | get () |
Block until the ReplyMap is fulfilled, then return the map by reference. More... | |
Public Attributes | |
map_fut | pending_rmap |
Private Attributes | |
ReplyMap | replies {*this} |
Data structure that (indirectly) holds a set of futures for a single RPC function call; there is one future for each node contacted to make the call, and it will eventually contain that node's reply.
The futures are actually stored inside an internal struct of type ReplyMap, which can be retrieved with the get() method. The ReplyMap will not be returned until it is "fulfilled" by the sender, which should happen when the RPC call is delivered in the current View (and thus, the current View is the set of nodes who should reply to the RPC).
Ret | The return type of the RPC function that this query invoked |
Definition at line 158 of file rpc_utils.hpp.
using derecho::rpc::QueryResults< Ret >::map = reply_map<Ret> |
Definition at line 161 of file rpc_utils.hpp.
using derecho::rpc::QueryResults< Ret >::map_fut = std::future<std::unique_ptr<reply_map<Ret> >> |
Definition at line 160 of file rpc_utils.hpp.
using derecho::rpc::QueryResults< Ret >::type = Ret |
Definition at line 162 of file rpc_utils.hpp.
|
inline |
Definition at line 208 of file rpc_utils.hpp.
|
inline |
Definition at line 209 of file rpc_utils.hpp.
|
delete |
|
inline |
Block until the ReplyMap is fulfilled, then return the map by reference.
The ReplyMap is only valid as long as this QueryResults remains in scope, and cannot be copied.
Definition at line 235 of file rpc_utils.hpp.
|
inline |
Wait the specified duration; if a ReplyMap is available after that duration, return it.
Otherwise return nullptr.
Definition at line 219 of file rpc_utils.hpp.
map_fut derecho::rpc::QueryResults< Ret >::pending_rmap |
Definition at line 202 of file rpc_utils.hpp.
|
private |
Definition at line 205 of file rpc_utils.hpp.