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

Simplify DeferredExecutor

Summary: Move the wait() and timed_wait() functionality out of DeferredExecutor. This is now possible because folly::Futures are using Executor::KeepAlive to manage executors' life-time.

Reviewed By: LeeHowes

Differential Revision: D9925417

fbshipit-source-id: e9818417048f44ee66648439e781060fdabca6b9
parent e3f27085
This diff is collapsed.
......@@ -447,7 +447,8 @@ template <typename T>
DeferredExecutor* getDeferredExecutor(SemiFuture<T>& future);
template <typename T>
DeferredExecutor* stealDeferredExecutor(SemiFuture<T>& future);
folly::Executor::KeepAlive<DeferredExecutor> stealDeferredExecutor(
SemiFuture<T>& future);
} // namespace detail
} // namespace futures
......@@ -876,8 +877,8 @@ class SemiFuture : private futures::detail::FutureBase<T> {
friend class SemiFuture;
template <class>
friend class Future;
friend DeferredExecutor* futures::detail::stealDeferredExecutor<T>(
SemiFuture&);
friend folly::Executor::KeepAlive<DeferredExecutor>
futures::detail::stealDeferredExecutor<T>(SemiFuture&);
friend DeferredExecutor* futures::detail::getDeferredExecutor<T>(SemiFuture&);
using Base::setExecutor;
......@@ -896,7 +897,7 @@ class SemiFuture : private futures::detail::FutureBase<T> {
DeferredExecutor* getDeferredExecutor() const;
// Throws FutureInvalid if !this->core_
DeferredExecutor* stealDeferredExecutor() const;
folly::Executor::KeepAlive<DeferredExecutor> stealDeferredExecutor() const;
/// Blocks until the future is fulfilled, or `dur` elapses.
///
......
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