Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add when_all() function for waiting for multiple tasks to complete #10

Closed
lewissbaker opened this issue May 9, 2017 · 3 comments
Closed
Assignees

Comments

@lewissbaker
Copy link
Owner

No description provided.

@lewissbaker lewissbaker self-assigned this Jul 25, 2017
@lewissbaker
Copy link
Owner Author

Commit 67fea7f adds initial support for a when_all_ready() function that takes a number of tasks and concurrently waits for them all to complete, returning those tasks back in the result without rethrowing any exceptions in the task results.

It also adds support for when_all() which waits until all tasks are ready and then unpacks the results into a value (either tuple or vector depending on the overload). This variation will throw an exception if any of the tasks throws an exception.

Added variadic overloads of these two functions that return std::tuple results.
Also added overloads that take std::vector of homogeneous tasks that return std::vector of results.

Documentation of these functions is still pending.

@lewissbaker
Copy link
Owner Author

It would be really handy to add support for when_all() of void-returning task types.
Event better if I can combine void-returning task types with non-void-returning task types.

Perhaps when_all() could translate void-returning tasks into some empty struct (like cppcoro::unit or cppcoro::void_value) so that it can be stored in the std::tuple<> returned by when_all()?

@lewissbaker
Copy link
Owner Author

Documentation added in e6355df

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant