From dbf0c41058bf6f45ed016856515700842ae73f1a Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Wed, 18 Oct 2017 15:01:33 -0700 Subject: [PATCH] move futures/ScheduledExecutor to executors/ScheduledExecutor Summary: see title Reviewed By: yfeldblum Differential Revision: D6062601 fbshipit-source-id: edd9a5e85f4ebecd1a6f1004a4d3b8b43b935c2b --- folly/Makefile.am | 3 +-- folly/{futures => executors}/ScheduledExecutor.h | 0 folly/futures/ManualExecutor.h | 2 +- folly/futures/README.md | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) rename folly/{futures => executors}/ScheduledExecutor.h (100%) diff --git a/folly/Makefile.am b/folly/Makefile.am index bb2d3e14..b9adb7f6 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -100,6 +100,7 @@ nobase_follyinclude_HEADERS = \ executors/NotificationQueueExecutor.h \ executors/PriorityLifoSemMPMCQueue.h \ executors/PriorityThreadFactory.h \ + executors/ScheduledExecutor.h \ executors/SerialExecutor.h \ executors/ThreadFactory.h \ executors/ThreadPoolExecutor.h \ @@ -218,8 +219,6 @@ nobase_follyinclude_HEADERS = \ futures/Promise-inl.h \ futures/Promise.h \ futures/QueuedImmediateExecutor.h \ - futures/Retrying.h \ - futures/ScheduledExecutor.h \ futures/SharedPromise.h \ futures/SharedPromise-inl.h \ futures/ThreadWheelTimekeeper.h \ diff --git a/folly/futures/ScheduledExecutor.h b/folly/executors/ScheduledExecutor.h similarity index 100% rename from folly/futures/ScheduledExecutor.h rename to folly/executors/ScheduledExecutor.h diff --git a/folly/futures/ManualExecutor.h b/folly/futures/ManualExecutor.h index 373e4ac7..a45de257 100644 --- a/folly/futures/ManualExecutor.h +++ b/folly/futures/ManualExecutor.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace folly { /// A ManualExecutor only does work when you turn the crank, by calling diff --git a/folly/futures/README.md b/folly/futures/README.md index e4bce679..b839056d 100644 --- a/folly/futures/README.md +++ b/folly/futures/README.md @@ -730,7 +730,7 @@ Although inspired by the C++11 std::future interface, it is not a drop-in replac
  • ManualExecutor only executes work when manually cranked. This is useful for testing.
  • InlineExecutor executes work immediately inline
  • QueuedImmediateExecutor is similar to InlineExecutor, but work added during callback execution will be queued instead of immediately executed
  • -
  • ScheduledExecutor is a subinterface of Executor that supports scheduled (i.e. delayed) execution. There aren't many implementations yet, see T5924392
  • +
  • ScheduledExecutor is a subinterface of Executor that supports scheduled (i.e. delayed) execution. There aren't many implementations yet, see T5924392
  • Thrift's ThreadManager is an Executor but we aim to deprecate it in favor of the aforementioned CPUThreadPoolExecutor
  • FutureExecutor wraps another Executor and provides Future<T> addFuture(F func) which returns a Future representing the result of func. This is equivalent to futures::async(executor, func) and the latter should probably be preferred.
  • Timeouts and related features

    Futures provide a number of timing-related features. Here's an overview.

    Timing implementation #

    -- 2.34.1