While this class is public, it should typically be constructed using the factory functions defined later, as those handle appropriate selection of the TimeoutFuture and TimeoutResolution type parameters based on the PrimaryFuture type and timeout value you use in constructing a FutureWithTimeout.
Combines a primary (value) future with a secondary (timeout) future. This type is itself a future.
Invoking the Pend() member function invokes Pend() on both the primary and secondary futures.
When pended, the primary future is checked first. If that result is Ready(T), then that Ready value is returned from the FutureWithTimeout wrapper's Pend().
If the primary future is Pending, then the secondary timeout future is checked. If that is Ready, then the TimeoutResolution policy class type argument is used to decide what value should be returned.
Public Member Functions | |
| FutureWithTimeout (PrimaryFuture &&primary_future, TimeoutFuture &&timeout_future, TimeoutResolution &&timeout_resolution) | |
Public Member Functions inherited from pw::async2::Future< FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution >, T > | |
| Poll< value_type > | Pend (Context &cx) |
| bool | is_complete () const |
Additional Inherited Members | |
Public Types inherited from pw::async2::Future< FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution >, T > | |
| using | value_type = std::conditional_t< std::is_void_v< T >, ReadyType, T > |