MCPcopy Create free account
hub / github.com/bloomberg/quantum / IThreadFutureBase

Class IThreadFutureBase

quantum/interface/quantum_ithread_future_base.h:32–53  ·  view source on GitHub ↗

============================================================================================== interface IThreadFutureBase ============================================================================================== @interface ICoroFutureBase @brief Exposes methods to access a non-coroutine future (i.e. accessed from a thread)

Source from the content-addressed store, hash-verified

30/// @interface ICoroFutureBase
31/// @brief Exposes methods to access a non-coroutine future (i.e. accessed from a thread)
32struct IThreadFutureBase
33{
34 using Ptr = std::shared_ptr<IThreadFutureBase>;
35
36 /// @brief Virtual destructor
37 virtual ~IThreadFutureBase() = default;
38
39 /// @brief Determines if this future still has a shared state with the promise object.
40 /// @return True if valid, false otherwise.
41 virtual bool valid() const = 0;
42
43 /// @brief Waits for the future value.
44 /// @note This method blocks until the future is ready or until an exception is thrown.
45 virtual void wait() const = 0;
46
47 /// @brief Waits for the future value up to a maximum 'timeMs' milliseconds.
48 /// @param[in] timeMs The maximum amount of milliseconds to wait until the future value becomes ready.
49 /// Using -1 is equivalent to calling wait(). Other negative values will throw.
50 /// @return 'ready' if value was posted before duration expired or 'timeout' otherwise.
51 /// @note Blocks until the value is ready, until 'timeMs' duration expires or until an exception is thrown.
52 virtual std::future_status waitFor(std::chrono::milliseconds timeMs) const = 0;
53};
54
55using IThreadFutureBasePtr = IThreadFutureBase::Ptr;
56

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected