boost::capy::run_async

run_async overloads

Synopses

Asynchronously launch a lazy task on the given executor.

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

Asynchronously launch a lazy task with stop token support.

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

Asynchronously launch a lazy task with custom memory resource.

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

Asynchronously launch a lazy task with a result handler.

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

Asynchronously launch a lazy task with stop token and memory resource.

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

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

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

Asynchronously launch a lazy task with memory resource and handler.

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

Asynchronously launch a lazy task with separate result and error handlers.

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

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

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

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

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

Asynchronously launch a lazy task with memory resource and handlers.

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

Asynchronously launch a lazy task with allocator and handlers.

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

Asynchronously launch a lazy task with stop token, memory resource, and handlers.

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);

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

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.

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.

h1

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

alloc

The allocator for frame allocation (copied and stored).

h2

The handler to invoke with the exception on failure.

See Also

task

executor

Created with MrDocs