Overview

Here’s a list of relevant featuers in async:

Table 1. Coroutine types

promise

An eager coroutine returning a single result- consider it the default

generator

An eager coroutine that can yield multiple values.

task

A lazy version of promise that can be spawned onto other executors.

detached

A coroutine similar to promise, without a handle

Table 2. Synchronization Functions

select

A function that waits for one coroutine out of a set that is ready in a pseudo-random way, to avoid starvation.

join

A function that waits for a set of coroutines and returns all of them as value or throws an exception if any awaitable does so.

gather

A function that waits for a set of coroutines and returns all of them as result, capturing all exceptions individually.

left_select

A deterministic select that evaluates left-to-right.

Table 3. Utilities

channel

A thread-local utility to send values between coroutines.

with

An async RAII helper, that allows async teardown when exceptions occur

Table 4. Reading guide

Coroutine Primer

A short introduction to C++ coroutines

Read if you’ve never used coroutines before

Tour

An abbreviated high level view of the features and concepts

Read if you’re familiar with asio & coroutines and want a rough idea what this library offers.

Tutorial

Low level view of usages

Read if you want to get coding quickly

Reference

API reference

Look up details while coding

Technical Background

Some implementation details

Read if you’re not confused enough