|
ORIGINAL
|
Asynchronous programming utilities with future/promise pattern. More...
#include <async.h>

Classes | |
| class | asyncWrapper< void > |
| Specialization of asyncWrapper for void results. More... | |
| class | future |
| Represents a one-shot future result of an asynchronous computation. More... | |
| class | future< void > |
| Specialization of future for void results. More... | |
| class | futureBase |
| Abstract base interface for asynchronous consumers. More... | |
| class | promise |
| Represents a one-time asynchronous producer with result setting capability. More... | |
| class | promise< void, Callback > |
| Specialization of promise for void results. More... | |
| class | sharedFuture |
| Represents a sharable asynchronous result. More... | |
| class | sharedFuture< void > |
Static Public Member Functions | |
| template<typename Callback , typename... Args> | |
| static auto | makePromise (Callback &&c, Args &&... args) |
| Creates a promise from a callable and arguments. | |
| template<typename Callback , typename... Args> | |
| static auto | get (Callback &&c, Args &&... args) -> future< std::invoke_result_t< std::decay_t< Callback >, std::decay_t< Args >... > > |
| Executes a callable asynchronously and returns a future for the result. | |
Asynchronous programming utilities with future/promise pattern.
Provides a thread-safe implementation of the future/promise pattern for asynchronous computation. Supports both value-returning and void functions.
|
static |
Executes a callable asynchronously and returns a future for the result.
| Callback | The type of the callable |
| Args | The types of the arguments |
| c | Callable to execute |
| args | Arguments to forward to the callable |
Creates a promise from a callable and arguments.
| Callback | The type of the callable |
| Args | The types of the arguments |
| c | Callable to execute asynchronously |
| args | Arguments to forward to the callable |
The created promise is a single-use object that can be executed exactly once via run() or have its function extracted via function().