boost::capy::io_env

Execution environment for IoAwaitables.

Synopsis

Declared in <boost/capy/ex/io_env.hpp>

struct io_env;

Description

This struct bundles the execution context passed through coroutine chains via the IoAwaitable protocol. It contains the executor for resumption, a stop token for cancellation, and an optional allocator for coroutine frame allocation.

Lifetime

Launch functions (run_async, run) own the io_env and guarantee it outlives all tasks and awaitables in the launched chain. Awaitables receive io_env const* in await_suspend and should store it directly, never copy the pointed‐to object.

Thread Safety

The referenced executor and allocator must remain valid for the lifetime of any coroutine using this environment.

Data Members

Name

Description

allocator

The allocator for coroutine frame allocation.

executor

The executor for coroutine resumption.

stop_token

The stop token for cancellation propagation.

See Also

IoAwaitable, IoRunnable

Created with MrDocs