Skip to content

Commit

Permalink
Rename FutureAwaitable to FutureAwaiter.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mpark authored and facebook-github-bot committed Oct 28, 2020
1 parent 063ef0c commit 0c20854
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions folly/futures/Future.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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_);
Expand All @@ -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
Expand Down

0 comments on commit 0c20854

Please sign in to comment.