Add support for co_awaitTry(task.scheduleOn())
Summary: This adds support for applying the co_awaitTry() algorithm to a TaskWithExecutor type. This required a bit of a refactor of the `co_awaitTry()` implementtion to not require that it's passed a SemiAwaitable but and to allow Awaitable objects to also be passed to `co_awaitTry()`. Renamed TaskWithExecutor::InlineAwaiter to InlineTryAwaitable and make it private to better reflect its purpose. No longer implement `Task::Awaiter::await_resume()` in terms of the `await_resume_try()` method. This should avoid a call to the Try<T> move-constructor by extracting the T result directly from the Try<T> stored in the promise. Reviewed By: andriigrynenko Differential Revision: D24602729 fbshipit-source-id: d352e717877769502cc55a01731eb165ddad9ad8
Showing
Please register or sign in to comment