Commit 973d5f61 authored by James Sedgwick's avatar James Sedgwick Committed by JoelMarcey

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
parent 70d6b0b6
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <functional> #include <functional>
namespace folly { namespace wangle { namespace folly {
typedef std::function<void()> Func; typedef std::function<void()> Func;
...@@ -43,4 +43,4 @@ class Executor { ...@@ -43,4 +43,4 @@ class Executor {
} }
}; };
}} // folly::wangle } // folly
...@@ -65,6 +65,7 @@ nobase_follyinclude_HEADERS = \ ...@@ -65,6 +65,7 @@ nobase_follyinclude_HEADERS = \
dynamic-inl.h \ dynamic-inl.h \
Exception.h \ Exception.h \
ExceptionWrapper.h \ ExceptionWrapper.h \
Executor.h \
EvictingCacheMap.h \ EvictingCacheMap.h \
experimental/Bits.h \ experimental/Bits.h \
experimental/EliasFanoCoding.h \ experimental/EliasFanoCoding.h \
...@@ -235,7 +236,6 @@ nobase_follyinclude_HEADERS = \ ...@@ -235,7 +236,6 @@ nobase_follyinclude_HEADERS = \
Varint.h \ Varint.h \
VersionCheck.h \ VersionCheck.h \
wangle/Deprecated.h \ wangle/Deprecated.h \
wangle/Executor.h \
wangle/Future-inl.h \ wangle/Future-inl.h \
wangle/Future.h \ wangle/Future.h \
wangle/InlineExecutor.h \ wangle/InlineExecutor.h \
......
...@@ -105,7 +105,7 @@ class ServerWorkerFactory : public folly::wangle::ThreadFactory { ...@@ -105,7 +105,7 @@ class ServerWorkerFactory : public folly::wangle::ThreadFactory {
std::make_shared<folly::wangle::NamedThreadFactory>("BootstrapWorker")) std::make_shared<folly::wangle::NamedThreadFactory>("BootstrapWorker"))
, acceptorFactory_(acceptorFactory) , acceptorFactory_(acceptorFactory)
{} {}
virtual std::thread newThread(folly::wangle::Func&& func) override; virtual std::thread newThread(folly::Func&& func) override;
void setInternalFactory( void setInternalFactory(
std::shared_ptr<folly::wangle::NamedThreadFactory> internalFactory); std::shared_ptr<folly::wangle::NamedThreadFactory> internalFactory);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace folly { namespace folly {
std::thread ServerWorkerFactory::newThread( std::thread ServerWorkerFactory::newThread(
folly::wangle::Func&& func) { folly::Func&& func) {
auto id = nextWorkerId_++; auto id = nextWorkerId_++;
auto worker = acceptorFactory_->newAcceptor(); auto worker = acceptorFactory_->newAcceptor();
{ {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <thread> #include <thread>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h> #include <folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h>
#include <folly/experimental/wangle/concurrent/NamedThreadFactory.h> #include <folly/experimental/wangle/concurrent/NamedThreadFactory.h>
#include <folly/experimental/wangle/rx/Observable.h> #include <folly/experimental/wangle/rx/Observable.h>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
using namespace folly::wangle; using namespace folly::wangle;
using namespace std::chrono; 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)); }; return [ms]() { std::this_thread::sleep_for(milliseconds(ms)); };
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <folly/SmallLocks.h> #include <folly/SmallLocks.h>
#include <folly/ThreadLocal.h> #include <folly/ThreadLocal.h>
#include <folly/small_vector.h> #include <folly/small_vector.h>
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <map> #include <map>
#include <memory> #include <memory>
......
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
#pragma once #pragma once
#include <folly/ExceptionWrapper.h> #include <folly/ExceptionWrapper.h>
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
namespace folly { namespace wangle { namespace folly { namespace wangle {
typedef folly::exception_wrapper Error; 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. // alias it.
typedef std::shared_ptr<folly::wangle::Executor> SchedulerPtr; typedef std::shared_ptr<folly::Executor> SchedulerPtr;
template <class T, size_t InlineObservers = 3> struct Observable; template <class T, size_t InlineObservers = 3> struct Observable;
template <class T> struct Observer; template <class T> struct Observer;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <folly/io/async/AsyncTimeout.h> #include <folly/io/async/AsyncTimeout.h>
#include <folly/io/async/TimeoutManager.h> #include <folly/io/async/TimeoutManager.h>
#include <folly/io/async/Request.h> #include <folly/io/async/Request.h>
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <memory> #include <memory>
#include <stack> #include <stack>
#include <list> #include <list>
...@@ -96,7 +96,7 @@ class RequestEventBase : public RequestData { ...@@ -96,7 +96,7 @@ class RequestEventBase : public RequestData {
* another thread it is explicitly listed in the method comments. * another thread it is explicitly listed in the method comments.
*/ */
class EventBase : class EventBase :
private boost::noncopyable, public TimeoutManager, public wangle::Executor private boost::noncopyable, public TimeoutManager, public Executor
{ {
public: public:
/** /**
...@@ -478,7 +478,7 @@ class EventBase : ...@@ -478,7 +478,7 @@ class EventBase :
*/ */
const std::string& getName(); const std::string& getName();
/// Implements the wangle::Executor interface /// Implements the Executor interface
void add(Cob fn) override { void add(Cob fn) override {
// runInEventBaseThread() takes a const&, // runInEventBaseThread() takes a const&,
// so no point in doing std::move here. // so no point in doing std::move here.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
namespace folly { namespace wangle { namespace folly { namespace wangle {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
namespace folly { namespace wangle { namespace folly { namespace wangle {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <chrono> #include <chrono>
#include <memory> #include <memory>
#include <stdexcept> #include <stdexcept>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <folly/wangle/Try.h> #include <folly/wangle/Try.h>
#include <folly/wangle/Promise.h> #include <folly/wangle/Promise.h>
#include <folly/wangle/Future.h> #include <folly/wangle/Future.h>
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <folly/wangle/detail/FSM.h> #include <folly/wangle/detail/FSM.h>
#include <folly/io/async/Request.h> #include <folly/io/async/Request.h>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <type_traits> #include <type_traits>
#include <unistd.h> #include <unistd.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
#include <folly/wangle/Future.h> #include <folly/wangle/Future.h>
#include <folly/wangle/ManualExecutor.h> #include <folly/wangle/ManualExecutor.h>
#include <folly/MPMCQueue.h> #include <folly/MPMCQueue.h>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
TEST(Future, thenVariants) { TEST(Future, thenVariants) {
SomeClass anObject; SomeClass anObject;
Executor* anExecutor; folly::Executor* anExecutor;
{Future<B> f = someFuture<A>().then(&aFunction<Future<B>, Try<A>&&>);} {Future<B> f = someFuture<A>().then(&aFunction<Future<B>, Try<A>&&>);}
{Future<B> f = someFuture<A>().then(&SomeClass::aStaticMethod<Future<B>, Try<A>&&>);} {Future<B> f = someFuture<A>().then(&SomeClass::aStaticMethod<Future<B>, Try<A>&&>);}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <memory> #include <memory>
#include <folly/wangle/Future.h> #include <folly/wangle/Future.h>
#include <folly/wangle/Executor.h> #include <folly/Executor.h>
using namespace folly::wangle; using namespace folly::wangle;
using namespace std; using namespace std;
......
...@@ -70,7 +70,7 @@ print <<EOF ...@@ -70,7 +70,7 @@ print <<EOF
TEST(Future, thenVariants) { TEST(Future, thenVariants) {
SomeClass anObject; SomeClass anObject;
Executor* anExecutor; folly::Executor* anExecutor;
#{tests.join("\n ")} #{tests.join("\n ")}
} }
......
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