You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use co_withExecutor in feed_ranking_infra/serving_eval/RankLlmIValueDataEnricher.cpp +5
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: D77751576
fbshipit-source-id: 71a6a7e4f78494decb93b5bf8afa1382f94d71e9
0 commit comments