|
ORIGINAL
|
Abstract base interface for asynchronous consumers. More...
#include <async.h>


Public Member Functions | |
| virtual bool | valid () const noexcept=0 |
| Checks if the future is valid (has an associated async wrapper) | |
| virtual void | wait () const =0 |
| Waits until the result becomes ready. | |
| virtual bool | waitFor (time::duration timeout) const =0 |
| Waits for the result with a timeout. | |
| virtual std::exception_ptr | exception () const noexcept=0 |
| Gets the stored exception if computation failed. | |
| virtual bool | ready () const =0 |
| Checks if the result is ready. | |
Abstract base interface for asynchronous consumers.
Provides a common, type-erased interface for accessing asynchronous results, regardless of their actual type or ownership semantics.
Key methods include:
valid() : check if the consumer is validready() : check if the result is readywait() : block until readywaitFor() : Block with a timeoutexception(): retrieve any stored exception
|
pure virtualnoexcept |
Gets the stored exception if computation failed.
Implemented in original::async::future< TYPE >, original::async::sharedFuture< TYPE >, original::async::future< void >, and original::async::sharedFuture< void >.
Checks if the result is ready.
Implemented in original::async::future< TYPE >, original::async::sharedFuture< TYPE >, original::async::future< void >, and original::async::sharedFuture< void >.
Checks if the future is valid (has an associated async wrapper)
Implemented in original::async::future< TYPE >, original::async::sharedFuture< TYPE >, original::async::future< void >, and original::async::sharedFuture< void >.
Waits until the result becomes ready.
Implemented in original::async::future< TYPE >, original::async::sharedFuture< TYPE >, original::async::future< void >, and original::async::sharedFuture< void >.
|
pure virtual |
Waits for the result with a timeout.
| timeout | Maximum time to wait |
Implemented in original::async::future< TYPE >, original::async::sharedFuture< TYPE >, original::async::future< void >, and original::async::sharedFuture< void >.