17 #ifndef __FUTURE_TRACKER_HPP__ 18 #define __FUTURE_TRACKER_HPP__ 39 std::map<std::string, std::string>
args;
69 void eraseFuture(
typename std::list<FutureMetadata>::iterator it)
76 return std::vector<FutureMetadata>(
pending.begin(),
pending.end());
80 std::list<FutureMetadata>
pending;
115 template <
typename T>
120 const std::map<std::string, std::string>&
args = {})
124 &PendingFutureTrackerProcess::addFuture<T>,
157 #endif // __FUTURE_TRACKER_HPP__ std::string generate(const std::string &prefix="")
Returns 'prefix(N)' where N represents the number of instances where the same prefix (wrt...
process::Future< std::vector< FutureMetadata > > pendingFutures()
This method returns a list of pending futures represented as objects of FutureMetadata class...
Definition: future_tracker.hpp:136
bool pending(int signal)
Definition: signals.hpp:50
PendingFutureTrackerProcess()
Definition: future_tracker.hpp:54
Definition: future_tracker.hpp:50
static Try< PendingFutureTracker * > create()
Definition: future_tracker.hpp:87
~PendingFutureTracker()
Definition: future_tracker.hpp:93
process::Future< std::vector< FutureMetadata > > pendingFutures()
Definition: future_tracker.hpp:74
UPID spawn(ProcessBase *process, bool manage=false)
Spawn a new process.
void terminate(const UPID &pid, bool inject=true)
Sends a TerminateEvent to the given process.
void addFuture(const process::Future< T > &future, FutureMetadata &&metadata)
Definition: future_tracker.hpp:58
void dispatch(const PID< T > &pid, void(T::*method)())
Definition: dispatch.hpp:174
Definition: future_tracker.hpp:84
const Future< T > & onAny(AnyCallback &&callback) const
Definition: future.hpp:1442
void eraseFuture(typename std::list< FutureMetadata >::iterator it)
Definition: future_tracker.hpp:69
process::Future< T > track(const process::Future< T > &future, const std::string &operation, const std::string &component, const std::map< std::string, std::string > &args={})
This method subscribes on state transitions of the future to keep track of pending operations/promise...
Definition: future_tracker.hpp:116
bool wait(const UPID &pid, const Duration &duration=Seconds(-1))
Wait for the process to exit for no more than the specified seconds.
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
Definition: attributes.hpp:24
Definition: executor.hpp:48
Definition: process.hpp:505
Deferred< void()> defer(const PID< T > &pid, void(T::*method)())
Definition: defer.hpp:35
Definition: future.hpp:58