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 | sync_generator_adapter |
Adapter for converting asynchronous generators to synchronous generators. More... | |
class | task |
A coroutine task. More... | |
Functions | |
template<typename Awaitable, typename... Args> | |
eager_task | run_awaitable (Awaitable &&f, Args &&... args) |
Turns any awaitable into an eager fire-and-forget coroutine. | |
template<typename Result> | |
sync_generator_adapter (async_generator< Result >) -> sync_generator_adapter< Result > | |
Deduction guide for sync_generator_adapter . | |
Library namespace.
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 130 of file eager_task.h.
wwa::coro::sync_generator_adapter | ( | async_generator< Result > | ) | -> sync_generator_adapter< Result > |
Deduction guide for sync_generator_adapter
.
This deduction guide allows the sync_generator_adapter
class to be constructed without explicitly specifying the template argument.
Result | The type of the elements produced by the generator. |