Skip to content

Ability to wait for a single task? #38

@solbjorn

Description

@solbjorn

Just curious if there's ability to wait for a single task inside a fork-join block.

Let's say that at the start of the block, I fork 3 child tasks. Then, I need results from them at 3 different times in the continuation flow.
For sure, there's a join at the end of the block, but waiting for all of them in one place would decrease the efficiency.

Ia it possible to do something like that?

co_await fork(A);
co_await fork(B);
co_await fork(C);

do_some_work();

co_await wait(A);
some_more_work();

co_await wait(B);
moar_work();

co_await join;
continue_single_flow();

Or I need to let's say manually define some kind of barriers to block on waiting for single tasks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions