From dca6f3ea44d8fb0aaa1d4ae6761694b4ae9d0965 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Wed, 18 Oct 2017 09:44:09 -0700 Subject: [PATCH] move futures/DrivableExecutor to executors/DrivableExecutor Summary: as title Reviewed By: yfeldblum Differential Revision: D6062437 fbshipit-source-id: 4f99e779e280fdb0b1f035013caff18764e86ab5 --- folly/Makefile.am | 2 +- folly/{futures => executors}/DrivableExecutor.h | 0 folly/executors/NotificationQueueExecutor.h | 2 +- folly/futures/Future.h | 2 +- folly/futures/ManualExecutor.h | 2 +- folly/futures/README.md | 2 +- folly/futures/test/ViaTest.cpp | 2 +- folly/io/async/EventBase.h | 3 +-- 8 files changed, 7 insertions(+), 8 deletions(-) rename folly/{futures => executors}/DrivableExecutor.h (100%) diff --git a/folly/Makefile.am b/folly/Makefile.am index 94b417c2..7159baea 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -88,6 +88,7 @@ nobase_follyinclude_HEADERS = \ executors/BlockingQueue.h \ executors/CPUThreadPoolExecutor.h \ executors/Codel.h \ + executors/DrivableExecutor.h \ executors/FiberIOExecutor.h \ executors/FutureExecutor.h \ executors/GlobalExecutor.h \ @@ -205,7 +206,6 @@ nobase_follyinclude_HEADERS = \ Format-inl.h \ functional/Invoke.h \ futures/Barrier.h \ - futures/DrivableExecutor.h \ futures/Future-pre.h \ futures/helpers.h \ futures/Future.h \ diff --git a/folly/futures/DrivableExecutor.h b/folly/executors/DrivableExecutor.h similarity index 100% rename from folly/futures/DrivableExecutor.h rename to folly/executors/DrivableExecutor.h diff --git a/folly/executors/NotificationQueueExecutor.h b/folly/executors/NotificationQueueExecutor.h index 3738be24..5e19fc41 100644 --- a/folly/executors/NotificationQueueExecutor.h +++ b/folly/executors/NotificationQueueExecutor.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace folly { diff --git a/folly/futures/Future.h b/folly/futures/Future.h index f5c3190f..0c4092aa 100644 --- a/folly/futures/Future.h +++ b/folly/futures/Future.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/folly/futures/ManualExecutor.h b/folly/futures/ManualExecutor.h index 689111eb..373e4ac7 100644 --- a/folly/futures/ManualExecutor.h +++ b/folly/futures/ManualExecutor.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include namespace folly { diff --git a/folly/futures/README.md b/folly/futures/README.md index d0e2693d..e4bce679 100644 --- a/folly/futures/README.md +++ b/folly/futures/README.md @@ -902,7 +902,7 @@ Although inspired by the C++11 std::future interface, it is not a drop-in replac

getVia() and waitVia() #

-

T Future<T>::getVia(DrivableExecutor*) and Future<T> Future<T>::waitVia(DrivableExecutor*) have the same semantics as get() and wait() except that they drive some Executor until the Future is complete. DrivableExecutor is a simple subinterface of Executor that requires the presence of a method drive() which can somehow make progress on the Executor's work. Two commonly helpful implementations are EventBase (where drive() loops on the EventBase) and ManualExecutor. These are simple but useful sugar for the following common pattern:

+

T Future<T>::getVia(DrivableExecutor*) and Future<T> Future<T>::waitVia(DrivableExecutor*) have the same semantics as get() and wait() except that they drive some Executor until the Future is complete. DrivableExecutor is a simple subinterface of Executor that requires the presence of a method drive() which can somehow make progress on the Executor's work. Two commonly helpful implementations are EventBase (where drive() loops on the EventBase) and ManualExecutor. These are simple but useful sugar for the following common pattern:

Given this:

diff --git a/folly/futures/test/ViaTest.cpp b/folly/futures/test/ViaTest.cpp index 198c4f93..1a530d37 100644 --- a/folly/futures/test/ViaTest.cpp +++ b/folly/futures/test/ViaTest.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include diff --git a/folly/io/async/EventBase.h b/folly/io/async/EventBase.h index ee7ceca7..670d6af6 100644 --- a/folly/io/async/EventBase.h +++ b/folly/io/async/EventBase.h @@ -40,15 +40,14 @@ #include #include #include +#include #include -#include #include #include #include #include #include - namespace folly { using Cob = Func; // defined in folly/Executor.h -- 2.34.1