Commit 56600ae2 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook Github Bot

scheduleOn should accept a KeepAlive

Differential Revision: D16368120

fbshipit-source-id: 0511e2f84b3bf8d1affbfbeecd05c04cb0269037
parent 931299b7
......@@ -349,8 +349,8 @@ class FOLLY_NODISCARD Task {
/// Returns a new task that when co_awaited will launch execution of this
/// task on the specified executor.
FOLLY_NODISCARD
TaskWithExecutor<T> scheduleOn(Executor* executor) && noexcept {
coro_.promise().executor_ = getKeepAliveToken(executor);
TaskWithExecutor<T> scheduleOn(Executor::KeepAlive<> executor) && noexcept {
coro_.promise().executor_ = std::move(executor);
return TaskWithExecutor<T>{std::exchange(coro_, {})};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment