C/C++ API Reference
Loading...
Searching...
No Matches
Combining tasks

Oveview

Helpers for interacting with multiple pendables.

Classes

class  pw::async2::Join< Pendables >
 
class  pw::async2::Selector< Pendables >
 
struct  pw::async2::SelectResult< I, T >
 
struct  pw::async2::AllPendablesCompleted
 Indicates that every pendable within a Selector has completed. More...
 
class  pw::async2::WakerQueue< kCapacity >
 

Functions

 pw::async2::Join< Pendables >::Join (Pendables &&... pendables)
 Creates a Join from a series of pendable values.
 
Poll< TupleOfOutputRvalues > pw::async2::Join< Pendables >::Pend (Context &cx)
 
template<typename... Pendables>
 pw::async2::Join (Pendables &&...) -> Join< Pendables... >
 
template<typename... Pendables>
 pw::async2::Selector (Pendables &&...) -> Selector< Pendables... >
 
template<typename... Pendables>
auto pw::async2::Select (Context &cx, Pendables &&... pendables)
 
template<typename ResultVariant , typename AllPendablesCompletedHandler , typename... ReadyHandler>
void pw::async2::VisitSelectResult (ResultVariant &&variant, AllPendablesCompletedHandler &&on_all_pendables_completed, ReadyHandler &&... on_ready)
 

Function Documentation

◆ Pend()

template<typename... Pendables>
Poll< TupleOfOutputRvalues > pw::async2::Join< Pendables >::Pend ( Context cx)
inline

Attempts to complete all of the pendables, returning Ready with their results if all are complete.

◆ Select()

template<typename... Pendables>
auto pw::async2::Select ( Context cx,
Pendables &&...  pendables 
)

Returns the result of the first of the provided pendables which completes.

This Select function is intended for single use only. To iterate over all ready pendables, use Selector directly.

◆ VisitSelectResult()

template<typename ResultVariant , typename AllPendablesCompletedHandler , typename... ReadyHandler>
void pw::async2::VisitSelectResult ( ResultVariant &&  variant,
AllPendablesCompletedHandler &&  on_all_pendables_completed,
ReadyHandler &&...  on_ready 
)

Helper for interacting with a ResultVariant returned by a call to Select. See Selector documentation for example usage.