An InlineExecutor singleton
[folly.git] / folly / futures / InlineExecutor.h
index 5f1ae691f0794055bfbd731e47767194064e12d7..644ff7bf88489743c7e4be367b4477a3528465c7 100644 (file)
 
 namespace folly {
 
-  /// When work is "queued", execute it immediately inline.
-  /// Usually when you think you want this, you actually want a
-  /// QueuedImmediateExecutor.
-  class InlineExecutor : public Executor {
-   public:
-    void add(Func f) override {
-      f();
-    }
-  };
+/// When work is "queued", execute it immediately inline.
+/// Usually when you think you want this, you actually want a
+/// QueuedImmediateExecutor.
+class InlineExecutor : public Executor {
+ public:
+  static InlineExecutor& instance();
 
-}
+  void add(Func f) override {
+    f();
+  }
+};
+
+} // namespace folly