boost::capy::run_async

Asynchronously launch a lazy task with stop token and result handler.

Synopsis

template<
    Executor Ex,
    /* implementation-defined */ H1>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st,
    H1 h1);

Description

The stop token is propagated to the task for cooperative cancellation. The handler h1 is called with the result on success, and optionally with exception_ptr if it accepts that type.

Asynchronously launch a lazy task with stop token and allocator.

Return Value

A wrapper that accepts a task<T> for immediate execution.

Parameters

Name Description

ex

The executor to execute the task on.

st

The stop token for cooperative cancellation.

h1

The handler to invoke with the result (and optionally exception).

alloc

The allocator for frame allocation (copied and stored).

See Also

task

executor

Created with MrDocs