-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fold most
NowTask
logic into TaskWrapper
+ fixes
Summary: This improves `TaskWrapper` and makes `NowTask` nearly trivial. Up-stack, this also removes a bunch of duplicative protocol-forwarding code from `SafeTask`. Main refinements: - Much better doc coverage for `TaskWrapper`. - Add object slicing detection on methods that explicitly unwrap. - Add `promise_type` to `OpaqueTaskWrapperCrtp` since it seems desirable for it to always be a coroutine type. - Use configuration structs to make the setup of the CRTP bases cleaner and more flexible. - Provide `TaskWithExecutorWrapperCrtp` and a `TaskWithExecutorT` config so that `TaskWrapperCrtp` can reference it. - Stop forwarding unsafe APIs like `scheduleOn` and `semi`. - Rename some identifiers for brevity / readability. In particular, what used to be `protected` `unwrap()` became `unwrapTask()` and `unwrapTaskWithExecutor()` to avoid conflicting with the awaitable wrapper from `ViaIfAsync.h` and with the other `unwrap()` from `Task.h`. - Expand test coverage. Reviewed By: ispeters Differential Revision: D70805317 fbshipit-source-id: 19c7ee55ca1302b4094fe6ce1eff15cc2b56dc3e
- Loading branch information
1 parent
56896bf
commit efbf05d
Showing
4 changed files
with
622 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.