wwa-coro 0.0.1
Yet Another C++20 Coroutine Library
|
Library namespace. More...
Classes | |
class | async_generator |
An asynchronous generator that produces values of type Result . More... | |
class | bad_result_access |
Exception thrown when accessing a result that is not available. More... | |
class | bad_task |
Exception thrown when a coroutine task is invalid. More... | |
class | eager_task |
Eager coroutine. More... | |
class | generator |
An synchronous generator that produces values of type Result . More... | |
class | task |
A coroutine task. More... | |
Functions | |
template<typename AsyncGenerator, typename Callable> | |
task< void > | async_for_each (AsyncGenerator gen, Callable callable) |
template<typename Awaitable, typename... Args> | |
eager_task | run_awaitable (Awaitable &&f, Args &&... args) |
Turns any awaitable into an eager fire-and-forget coroutine. | |
Library namespace.
task< void > wwa::coro::async_for_each | ( | AsyncGenerator | gen, |
Callable | callable ) |
Definition at line 607 of file async_generator.h.
eager_task wwa::coro::run_awaitable | ( | Awaitable && | f, |
Args &&... | args ) |
Turns any awaitable into an eager fire-and-forget coroutine.
This method template takes an awaitable callable and its arguments, invokes the callable with the provided arguments, and co_await
's the result. It effectively runs the awaitable in a fire-and-forget manner.
Awaitable | The type of the awaitable callable. |
Args | The types of the arguments to be passed to the callable. |
f | The awaitable callable to be invoked. |
args | The arguments to be passed to the callable. |
Definition at line 129 of file eager_task.h.