boost::capy::run

Run a task with a custom stop token.

Synopsis

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

[[nodiscard]]
auto
run(std::stop_token st);

Description

The task inherits the caller's executor. Only the stop token is overridden.

Example

std::stop_source source;
co_await run(source.get_token())(cancellable_task());

Return Value

A wrapper that accepts a task for execution.

Parameters

Name Description

st

The stop token for cooperative cancellation.

Created with MrDocs