Commit 33c9ffb
Use
Summary:
`yourTask().scheduleOn(ex)` is deprecated in favor of `co_withExecutor(ex, yourTask())`
For `Task`, both forms are equivalent, but `co_withExecutor` makes it much easier to migrate to the [lifetime-safe `NowTask`](https://fb.prod.workplace.com/groups/192968587972839/posts/1784449738824708) (and upcoming `SafeTask`).
Thanks to [C++ ADL](https://en.cppreference.com/w/cpp/language/adl.html), you can write simply `co_withExecutor`; it does not *have* to be qualified with the namespace `folly::coro::`.
[This post](https://fb.prod.workplace.com/groups/192968587972839/posts/1693720697897613) explains the safety benefits of `co_withExecutor`. Moreover, the new name better aligns with the other `folly::coro` protocol of `co_withCancellation()`.
This diff generated with:
```
fbpython fbcode/scripts/rbarnes/schedule_on_fixer.py
```
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: meyering
Differential Revision: D77751702
fbshipit-source-id: fda192e43473821ec7862e861323c217c8bedfdbco_withExecutor in folly/docs/examples/folly/ExecutorGuide.cpp +51 parent b532ad3 commit 33c9ffb
File tree
1 file changed
+1
-1
lines changed- third-party/folly/src/folly/docs/examples/folly
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments