boost::capy::run_async

run_async overloads

Synopses

Bind an executor to produce a launcher. Invoke the launcher with a task to start it.

template<Executor Ex>
[[nodiscard]]
auto
run_async(Ex ex);

Bind an executor and a stop token to produce a launcher. Invoke the launcher with a task to start it.

template<Executor Ex>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st);

Bind an executor and a memory resource to produce a launcher. Invoke the launcher with a task to start it.

template<Executor Ex>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::pmr::memory_resource* mr);

Bind an executor and an allocator to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    /* implementation-defined */ Alloc>
[[nodiscard]]
auto
run_async(
    Ex ex,
    Alloc alloc);

Bind an executor and a result handler to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1>
requires detail::RunAsyncHandler<H1>
[[nodiscard]]
auto
run_async(
    Ex ex,
    H1 h1);

Bind an executor, a stop token, and a memory resource to produce a launcher. Invoke the launcher with a task to start it.

template<Executor Ex>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st,
    std::pmr::memory_resource* mr);

Bind an executor, a stop token, and an allocator to produce a launcher. Invoke the launcher with a task to start it.

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

Bind an executor, a stop token, and a result handler to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1>
requires detail::RunAsyncHandler<H1>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st,
    H1 h1);

Bind an executor, a memory resource, and a result handler to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::pmr::memory_resource* mr,
    H1 h1);

Bind an executor, an allocator, and a result handler to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    /* implementation-defined */ Alloc,
    class H1>
[[nodiscard]]
auto
run_async(
    Ex ex,
    Alloc alloc,
    H1 h1);

Bind an executor and separate result and error handlers to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1,
    class H2>
requires (detail::RunAsyncHandler<H1> && detail::RunAsyncHandler<H2>)
[[nodiscard]]
auto
run_async(
    Ex ex,
    H1 h1,
    H2 h2);

Bind an executor, a stop token, a memory resource, and a result handler to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st,
    std::pmr::memory_resource* mr,
    H1 h1);

Bind an executor, a stop token, an allocator, and a result handler to produce a launcher. Invoke the launcher with a task to start it.

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

Bind an executor, a stop token, and separate result and error handlers to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1,
    class H2>
requires (detail::RunAsyncHandler<H1> && detail::RunAsyncHandler<H2>)
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st,
    H1 h1,
    H2 h2);

Bind an executor, a memory resource, and separate result and error handlers to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1,
    class H2>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::pmr::memory_resource* mr,
    H1 h1,
    H2 h2);

Bind an executor, an allocator, and separate result and error handlers to produce a launcher. Invoke the launcher with a task to start it.

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

Bind an executor, a stop token, a memory resource, and separate result and error handlers to produce a launcher. Invoke the launcher with a task to start it.

template<
    Executor Ex,
    class H1,
    class H2>
[[nodiscard]]
auto
run_async(
    Ex ex,
    std::stop_token st,
    std::pmr::memory_resource* mr,
    H1 h1,
    H2 h2);

Bind an executor, a stop token, an allocator, and separate result and error handlers to produce a launcher. Invoke the launcher with a task to start it.

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

Return Value

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

The return value should not be discarded.

Parameters

Name

Description

ex

The executor to execute the task on.

st

The stop token for cooperative cancellation.

mr

The memory resource for frame allocation.

alloc

The allocator for frame allocation (copied and stored).

h1

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

h2

The handler to invoke with the exception on failure.

Preconditions

  • mr outlives every task started through the returned wrapper.

See Also