From 973d5f6166c4ab4aed4526fe1b0cfbb9e63c4fc8 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Mon, 15 Dec 2014 11:43:32 -0800 Subject: [PATCH] move wangle/Executor.h to folly/ root Summary: this removes the dep EventBase has on wangle as we prepare to split off wangle also changes namespace from folly::wangle to folly Test Plan: just a couple of codemods so waiting for contbuild Reviewed By: davejwatson@fb.com Subscribers: trunkagent, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, zeus-diffs@, nli, cold-storage-diffs@, unicorn-diffs@, targeting-diff-backend@, hannesr, vighnesh, fugalh, alandau, bmatheny, adityab, zhuohuang, luk, darshan, gunjan, hdoshi, dzhulgakov, alihussains, panin, ves, mshneer, folly-diffs@, lins, nimishshah FB internal diff: D1737376 Tasks: 5802833 Signature: t1:1737376:1418423430:82d219c34fcc50218c380a17435e5880e53db6bd --- folly/{wangle => }/Executor.h | 4 ++-- folly/Makefile.am | 2 +- folly/experimental/wangle/bootstrap/ServerBootstrap-inl.h | 2 +- folly/experimental/wangle/bootstrap/ServerBootstrap.cpp | 2 +- folly/experimental/wangle/concurrent/ThreadFactory.h | 2 +- folly/experimental/wangle/concurrent/ThreadPoolExecutor.h | 2 +- .../wangle/concurrent/test/ThreadPoolExecutorTest.cpp | 2 +- folly/experimental/wangle/rx/Observable.h | 2 +- folly/experimental/wangle/rx/types.h | 6 +++--- folly/io/async/EventBase.h | 6 +++--- folly/wangle/InlineExecutor.h | 2 +- folly/wangle/QueuedImmediateExecutor.h | 2 +- folly/wangle/ScheduledExecutor.h | 2 +- folly/wangle/detail/Core.h | 2 +- folly/wangle/test/FutureTest.cpp | 2 +- folly/wangle/test/Thens.cpp | 2 +- folly/wangle/test/Thens.h | 2 +- folly/wangle/test/thens.rb | 2 +- 18 files changed, 23 insertions(+), 23 deletions(-) rename folly/{wangle => }/Executor.h (95%) diff --git a/folly/wangle/Executor.h b/folly/Executor.h similarity index 95% rename from folly/wangle/Executor.h rename to folly/Executor.h index bd720f60..5ba4844b 100644 --- a/folly/wangle/Executor.h +++ b/folly/Executor.h @@ -18,7 +18,7 @@ #include -namespace folly { namespace wangle { +namespace folly { typedef std::function Func; @@ -43,4 +43,4 @@ class Executor { } }; -}} // folly::wangle +} // folly diff --git a/folly/Makefile.am b/folly/Makefile.am index 4f2d8da7..7f78fa66 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -65,6 +65,7 @@ nobase_follyinclude_HEADERS = \ dynamic-inl.h \ Exception.h \ ExceptionWrapper.h \ + Executor.h \ EvictingCacheMap.h \ experimental/Bits.h \ experimental/EliasFanoCoding.h \ @@ -235,7 +236,6 @@ nobase_follyinclude_HEADERS = \ Varint.h \ VersionCheck.h \ wangle/Deprecated.h \ - wangle/Executor.h \ wangle/Future-inl.h \ wangle/Future.h \ wangle/InlineExecutor.h \ diff --git a/folly/experimental/wangle/bootstrap/ServerBootstrap-inl.h b/folly/experimental/wangle/bootstrap/ServerBootstrap-inl.h index 7268e2a7..8db45409 100644 --- a/folly/experimental/wangle/bootstrap/ServerBootstrap-inl.h +++ b/folly/experimental/wangle/bootstrap/ServerBootstrap-inl.h @@ -105,7 +105,7 @@ class ServerWorkerFactory : public folly::wangle::ThreadFactory { std::make_shared("BootstrapWorker")) , acceptorFactory_(acceptorFactory) {} - virtual std::thread newThread(folly::wangle::Func&& func) override; + virtual std::thread newThread(folly::Func&& func) override; void setInternalFactory( std::shared_ptr internalFactory); diff --git a/folly/experimental/wangle/bootstrap/ServerBootstrap.cpp b/folly/experimental/wangle/bootstrap/ServerBootstrap.cpp index 594e9604..7a75452b 100644 --- a/folly/experimental/wangle/bootstrap/ServerBootstrap.cpp +++ b/folly/experimental/wangle/bootstrap/ServerBootstrap.cpp @@ -20,7 +20,7 @@ namespace folly { std::thread ServerWorkerFactory::newThread( - folly::wangle::Func&& func) { + folly::Func&& func) { auto id = nextWorkerId_++; auto worker = acceptorFactory_->newAcceptor(); { diff --git a/folly/experimental/wangle/concurrent/ThreadFactory.h b/folly/experimental/wangle/concurrent/ThreadFactory.h index 8f799065..7654fbc9 100644 --- a/folly/experimental/wangle/concurrent/ThreadFactory.h +++ b/folly/experimental/wangle/concurrent/ThreadFactory.h @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include diff --git a/folly/experimental/wangle/concurrent/ThreadPoolExecutor.h b/folly/experimental/wangle/concurrent/ThreadPoolExecutor.h index b6b0dd78..451f164f 100644 --- a/folly/experimental/wangle/concurrent/ThreadPoolExecutor.h +++ b/folly/experimental/wangle/concurrent/ThreadPoolExecutor.h @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include #include #include diff --git a/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp b/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp index 2749d0cd..9898d40e 100644 --- a/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp +++ b/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp @@ -24,7 +24,7 @@ using namespace folly::wangle; using namespace std::chrono; -static Func burnMs(uint64_t ms) { +static folly::Func burnMs(uint64_t ms) { return [ms]() { std::this_thread::sleep_for(milliseconds(ms)); }; } diff --git a/folly/experimental/wangle/rx/Observable.h b/folly/experimental/wangle/rx/Observable.h index 7a914696..e9a6196e 100644 --- a/folly/experimental/wangle/rx/Observable.h +++ b/folly/experimental/wangle/rx/Observable.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/folly/experimental/wangle/rx/types.h b/folly/experimental/wangle/rx/types.h index 0f10c1cb..27c2f3b7 100644 --- a/folly/experimental/wangle/rx/types.h +++ b/folly/experimental/wangle/rx/types.h @@ -17,13 +17,13 @@ #pragma once #include -#include +#include namespace folly { namespace wangle { typedef folly::exception_wrapper Error; - // The wangle::Executor is basically an rx Scheduler (by design). So just + // The Executor is basically an rx Scheduler (by design). So just // alias it. - typedef std::shared_ptr SchedulerPtr; + typedef std::shared_ptr SchedulerPtr; template struct Observable; template struct Observer; diff --git a/folly/io/async/EventBase.h b/folly/io/async/EventBase.h index ec4a6ad6..109da17c 100644 --- a/folly/io/async/EventBase.h +++ b/folly/io/async/EventBase.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -96,7 +96,7 @@ class RequestEventBase : public RequestData { * another thread it is explicitly listed in the method comments. */ class EventBase : - private boost::noncopyable, public TimeoutManager, public wangle::Executor + private boost::noncopyable, public TimeoutManager, public Executor { public: /** @@ -478,7 +478,7 @@ class EventBase : */ const std::string& getName(); - /// Implements the wangle::Executor interface + /// Implements the Executor interface void add(Cob fn) override { // runInEventBaseThread() takes a const&, // so no point in doing std::move here. diff --git a/folly/wangle/InlineExecutor.h b/folly/wangle/InlineExecutor.h index df9bfe29..e6924085 100644 --- a/folly/wangle/InlineExecutor.h +++ b/folly/wangle/InlineExecutor.h @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace folly { namespace wangle { diff --git a/folly/wangle/QueuedImmediateExecutor.h b/folly/wangle/QueuedImmediateExecutor.h index a4c4985d..a82c32db 100644 --- a/folly/wangle/QueuedImmediateExecutor.h +++ b/folly/wangle/QueuedImmediateExecutor.h @@ -16,7 +16,7 @@ #pragma once -#include +#include namespace folly { namespace wangle { diff --git a/folly/wangle/ScheduledExecutor.h b/folly/wangle/ScheduledExecutor.h index fe5f6f12..94850c28 100644 --- a/folly/wangle/ScheduledExecutor.h +++ b/folly/wangle/ScheduledExecutor.h @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/folly/wangle/detail/Core.h b/folly/wangle/detail/Core.h index 03d09b74..933cd7ad 100644 --- a/folly/wangle/detail/Core.h +++ b/folly/wangle/detail/Core.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/folly/wangle/test/FutureTest.cpp b/folly/wangle/test/FutureTest.cpp index a068dc01..d6cfbfbc 100644 --- a/folly/wangle/test/FutureTest.cpp +++ b/folly/wangle/test/FutureTest.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/folly/wangle/test/Thens.cpp b/folly/wangle/test/Thens.cpp index f990678d..e8ac875d 100644 --- a/folly/wangle/test/Thens.cpp +++ b/folly/wangle/test/Thens.cpp @@ -7,7 +7,7 @@ TEST(Future, thenVariants) { SomeClass anObject; - Executor* anExecutor; + folly::Executor* anExecutor; {Future f = someFuture().then(&aFunction, Try&&>);} {Future f = someFuture().then(&SomeClass::aStaticMethod, Try&&>);} diff --git a/folly/wangle/test/Thens.h b/folly/wangle/test/Thens.h index 995ff848..928f8205 100644 --- a/folly/wangle/test/Thens.h +++ b/folly/wangle/test/Thens.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include using namespace folly::wangle; using namespace std; diff --git a/folly/wangle/test/thens.rb b/folly/wangle/test/thens.rb index 9c753725..61ca26de 100755 --- a/folly/wangle/test/thens.rb +++ b/folly/wangle/test/thens.rb @@ -70,7 +70,7 @@ print <