Commit 0c20854f authored by Michael Park's avatar Michael Park Committed by Facebook GitHub Bot

Rename `FutureAwaitable` to `FutureAwaiter`.

Summary: Merely a terminology thing. An object returned by `co_await` is an awaiter, not an awaitable.

Reviewed By: yfeldblum, lewissbaker

Differential Revision: D24524929

fbshipit-source-id: ee9b7c8807972e78fff97f055d498977048d0c48
parent 063ef0c0
......@@ -2604,9 +2604,9 @@ namespace folly {
namespace detail {
template <typename T>
class FutureAwaitable {
class FutureAwaiter {
public:
explicit FutureAwaitable(folly::Future<T>&& future) noexcept
explicit FutureAwaiter(folly::Future<T>&& future) noexcept
: future_(std::move(future)) {}
bool await_ready() {
......@@ -2625,7 +2625,7 @@ class FutureAwaitable {
FOLLY_CORO_AWAIT_SUSPEND_NONTRIVIAL_ATTRIBUTES void await_suspend(
std::experimental::coroutine_handle<> h) {
// FutureAwaitable may get destroyed as soon as the callback is executed.
// FutureAwaiter may get destroyed as soon as the callback is executed.
// Make sure the future object doesn't get destroyed until setCallback_
// returns.
auto future = std::move(future_);
......@@ -2644,9 +2644,9 @@ class FutureAwaitable {
} // namespace detail
template <typename T>
inline detail::FutureAwaitable<T>
inline detail::FutureAwaiter<T>
/* implicit */ operator co_await(Future<T>&& future) noexcept {
return detail::FutureAwaitable<T>(std::move(future));
return detail::FutureAwaiter<T>(std::move(future));
}
} // namespace folly
......
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