ORIGINAL
Loading...
Searching...
No Matches
original::async Class Reference

Asynchronous programming utilities with future/promise pattern. More...

#include <async.h>

Collaboration diagram for original::async:
Collaboration graph

Classes

class  asyncWrapper< void >
 Specialization of asyncWrapper for void results. More...
 
class  future
 Represents a future result of an asynchronous computation. More...
 
class  future< void >
 Specialization of future for void results. More...
 
class  promise
 Represents a promise of a future result. More...
 
class  promise< void, Callback >
 Specialization of promise for void results. More...
 

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)
 Executes a callable asynchronously and gets the result.
 

Detailed Description

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.

Member Function Documentation

◆ get()

template<typename Callback , typename ... Args>
auto original::async::get ( Callback && c,
Args &&... args )
static

Executes a callable asynchronously and gets the result.

Template Parameters
CallbackThe type of the callable
ArgsThe types of the arguments
Parameters
cCallable to execute
argsArguments to forward to the callable
Returns
The result of the computation (blocks until ready)
Exceptions
std::exceptionif the computation threw an exception

◆ makePromise()

template<typename Callback , typename... Args>
auto original::async::makePromise ( Callback && c,
Args &&... args )
static

Creates a promise from a callable and arguments.

Template Parameters
CallbackThe type of the callable
ArgsThe types of the arguments
Parameters
cCallable to execute asynchronously
argsArguments to forward to the callable
Returns
A promise object for the asynchronous computation

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