Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::async::WhenAnyCancellableAwaiter< T > Class Template Reference

Awaitable that resolves when ANY of the input task FACTORIES completes (success or error). More...

#include <when_all.hpp>

Public Types

using Factory = std::function<Task<T>(CancellationToken)>
using Result = typename WhenAnyAwaiter<T>::Result

Public Member Functions

 WhenAnyCancellableAwaiter (std::vector< Factory > factories)
bool await_ready () const noexcept
bool await_suspend (std::coroutine_handle<> caller) noexcept
Result await_resume ()

Detailed Description

template<typename T>
class aria::async::WhenAnyCancellableAwaiter< T >

Awaitable that resolves when ANY of the input task FACTORIES completes (success or error).

Each factory receives its own CancellationToken; when a winner is established, every loser's token is fired so cooperative inner work unwinds promptly instead of running to completion in the background.

Note: cancellation is best-effort. Inner work that ignores its token still runs to completion off-stage; only its result and exception are dropped.

Member Typedef Documentation

◆ Factory

template<typename T>
using aria::async::WhenAnyCancellableAwaiter< T >::Factory = std::function<Task<T>(CancellationToken)>

◆ Result

template<typename T>
using aria::async::WhenAnyCancellableAwaiter< T >::Result = typename WhenAnyAwaiter<T>::Result

Constructor & Destructor Documentation

◆ WhenAnyCancellableAwaiter()

template<typename T>
aria::async::WhenAnyCancellableAwaiter< T >::WhenAnyCancellableAwaiter ( std::vector< Factory > factories)
inlineexplicit

Member Function Documentation

◆ await_ready()

template<typename T>
bool aria::async::WhenAnyCancellableAwaiter< T >::await_ready ( ) const
inlinenoexcept

◆ await_suspend()

template<typename T>
bool aria::async::WhenAnyCancellableAwaiter< T >::await_suspend ( std::coroutine_handle<> caller)
inlinenoexcept

◆ await_resume()

template<typename T>
Result aria::async::WhenAnyCancellableAwaiter< T >::await_resume ( )
inline

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