C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution, typename, typename, typename > Class Template Reference

Overview

template<typename T, typename PrimaryFuture, typename TimeoutFuture, typename TimeoutResolution, typename = std::enable_if_t<!std::is_lvalue_reference_v<PrimaryFuture>>, typename = std::enable_if_t<!std::is_lvalue_reference_v<TimeoutFuture>>, typename = std::enable_if_t<!std::is_lvalue_reference_v<TimeoutResolution>>>
class pw::async2::FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution, typename, typename, typename >

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 Types

using value_type = T
 

Public Member Functions

 FutureWithTimeout (PrimaryFuture &&primary_future, TimeoutFuture &&timeout_future, TimeoutResolution &&timeout_resolution)
 
constexpr bool is_pendable () const
 
constexpr bool is_complete () const
 
Poll< value_type > Pend (Context &cx)
 

The documentation for this class was generated from the following file: