GlobalExecutor.h include Executor.h and IOExecutor.h
authorHans Fugal <fugalh@fb.com>
Tue, 7 Apr 2015 01:20:00 +0000 (18:20 -0700)
committerViswanath Sivakumar <viswanath@fb.com>
Fri, 10 Apr 2015 03:34:11 +0000 (20:34 -0700)
Summary: We were forward-declaring `Executor` and `IOExecutor` for great compilation speed. However, this leaves users of this header to include at least one of those headers in their cpp file to actually use it, and that's kind of annoying. `Executor` and `IOExecutor` are not templated and are quite small, so it seems like the compilation speed benefit is minimal compared to the convenience factor, so this diff just includes the two headers. (Probably including `Executor.h` is redundant since `IOExecutor.h` probably includes it, but for completeness and explicitness, and in case `IOExecutor` also just forward-declares `Executor` now or in the future.)

Test Plan: stuff still builds

Reviewed By: davejwatson@fb.com

Subscribers: fugalh, exa, folly-diffs@, jsedgwick, yfeldblum, chalfant

FB internal diff: D1970179

Signature: t1:1970179:1428351076:e9c3700a868688035e7ff50486b8cead751d3c02

folly/wangle/concurrent/GlobalExecutor.h

index 409f51673fb755b3265d89aed072f3f06fa2b1e8..fa7d06c6d5f0fd923d090a8f3a317a2029b9e618 100644 (file)
@@ -18,9 +18,8 @@
 
 #include <memory>
 
-namespace folly {
-class Executor;
-}
+#include <folly/Executor.h>
+#include <folly/wangle/concurrent/IOExecutor.h>
 
 namespace folly { namespace wangle {
 
@@ -33,12 +32,11 @@ std::shared_ptr<Executor> getCPUExecutor();
 // subsequent calls to getCPUExecutor(). Takes a non-owning (weak) reference.
 void setCPUExecutor(std::shared_ptr<Executor> executor);
 
-// IOExecutors differ from Executors in that they drive and provide access to
-// one or more EventBases.
-class IOExecutor;
-
 // Retrieve the global IOExecutor. If there is none, a default
 // IOThreadPoolExecutor will be constructed and returned.
+//
+// IOExecutors differ from Executors in that they drive and provide access to
+// one or more EventBases.
 std::shared_ptr<IOExecutor> getIOExecutor();
 
 // Set an IOExecutor to be the global IOExecutor which will be returned by