Specialization for a future that does not return any value, just a completion signal.
Public Types | |
| using | value_type = void |
Public Member Functions | |
| ValueFuture (ValueFuture &&other) noexcept | |
| ValueFuture & | operator= (ValueFuture &&other) noexcept |
| void | Cancel () |
| Poll | Pend (Context &cx) |
| bool | is_pendable () const |
| bool | is_complete () const |
Static Public Member Functions | |
| static ValueFuture | Resolved () |
Protected Member Functions | |
| void | MoveFrom (ValueFuture &other) |
| template<typename Fn > | |
| void | MoveFrom (ValueFuture &other, Fn &&move_members) |
|
inline |
Cancels the future.
Always call Cancel() in the destructor of any class derived from ValueFuture to ensure the future is unlisted before the derived class members are destroyed.
|
inlineprotected |
Moves the base ValueFuture from other while holding the provider lock.
Use this overload when moving a ValueFuture or a derived future that has no additional state accessed by the provider. If the derived class has member variables that may be inspected by the provider (e.g., via ResolveIf or ResolveFirstMatching), use MoveFrom(other,
move_members) instead so that those members are moved atomically under the same lock acquisition.
|
inlineprotected |
Moves the base ValueFuture from other and invokes move_members while holding the provider lock.
Always call MoveFrom in the move constructor and move assignment operator of any class derived from ValueFuture to ensure derived class members are initialized before a concurrent provider operation can access the moved-to future.