-
-
Notifications
You must be signed in to change notification settings - Fork 67
co_awaiting multiple tasks in parallel #74
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
Comments
After some initial designing, the So I think the only viable solution is for |
Is this feature available now? |
Not yet, I only have an experimental implementation of |
This would also be extremely useful for us as well, specifically |
The |
Would std::stop_token be a viable option for coroutine cancelation? I too needed the ability to cancel a coroutine in our application and am playing around with this as a way to stop coroutine execution. |
It might be, but there are drawbacks as well - I created #107 with some brainstorming regarding cancellation. |
I have already ran into a case in QCoro where being able to co_await multiple tasks in parallel would make the code simpler , and I think there's a lot of potential hidden in this feature.
The idea of for the API is:
There's a question of composability, .e.g. should
return
std::tuple<T1, T2, T3>
orstd::tuple<std::tuple<T1, T2>, T3>
?Same goes for the
operator||
- should the result bestd::variant<T1, T2, T3>
orstd::variant<std::variant<T1, T2>, T3>
?I see benefit in having both, so I guess we could have
allOf
andfirstOf
functions to provide the flat result (as shown below) and leave theoperator||
andoperator&&
to return the nested types following the natural rules of operator precedence.The text was updated successfully, but these errors were encountered: