AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AFutureSet< T > Class Template Reference

Manages multiple futures. More...

#include <AUI/Thread/AThreadPool.h>

Detailed Description

template<typename T = void>
class AFutureSet< T >
Template Parameters
Tfuture's return type
Warning
This API is experimental. Experimental APIs are likely to contain bugs, might be changed or removed in the future.
AFutureSet involves functions to efficiently manage multiple AFutures.

Guarantees that held futures will never be executed or be during execution after AAsyncHolder is destroyed.

Member Function Documentation

> All members, including inherited

◆ onAllComplete()

template<typename T = void>
template<aui::invocable OnComplete>
void AFutureSet< T >::onAllComplete ( OnComplete && onComplete)
inline

Even if all tasks are already completed, it's guaranteed that your callback will be called.

The thread on which your callback will be called is undefined.

Note
AFutureSet is not required to be alive when AFutures would potentially call onSuccess callback since a temporary object is created to keep track of the task completeness.

◆ waitForAll()

template<typename T = void>
void AFutureSet< T >::waitForAll ( )
inline
Deprecated
use onAllComplete instead.