Add variadic folly::coro::collectAlll() and collectAllTry()
Summary: Adds two new functions to folly::coro for concurrently awaiting a fixed number of sub-tasks. * `folly::coro::collectAll(tasks...)` * `folly::coro::collectAllTry(tasks...)` Both can be used to concurrently await multiple input tasks. The difference is in how they report the results. `collectAll()` produces a tuple of the result values for each of the input operations. If any of the input operations fails with an exception then the whole operation fails with an exception (which one is unspecified) any successful results are discarded. `collectAllTry()` produces a tuple of `Try<T>` objects regardless of whether any of the input operations failed with an exception. The individual result objects can then be queried for the success/failure, allowing the caller to handle partial failure and/or determine which operation(s) failed. Reviewed By: andriigrynenko Differential Revision: D14334714 fbshipit-source-id: 22eb51e2198be42e77677a066bfbc15e1c7eb7dd
Showing
Please register or sign in to comment