boost::capy::run_async

Asynchronously launch a lazy task with stop token and separate handlers.

Synopsis

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

Description

The stop token is propagated to the task for cooperative cancellation. The handler h1 is called on success, h2 on failure.

Asynchronously launch a lazy task with stop token, allocator, and handler.

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 on success.

h2

The handler to invoke with the exception on failure.

alloc

The allocator for frame allocation (copied and stored).

See Also

task

executor

Created with MrDocs