Add 'runnable' callback to ExecutionObserver
[folly.git] / folly / experimental / fibers / ExecutionObserver.h
index 5cf1cc00c5fe72dd34e40bf8db47ea5899989f1f..ef5f8fb0bf8414c11d7d3d0bd3d47bea8c793489 100644 (file)
@@ -15,6 +15,8 @@
  */
 #pragma once
 
+#include <cstdint>
+
 namespace folly { namespace fibers {
 
 /**
@@ -26,13 +28,24 @@ class ExecutionObserver {
 
   /**
    * Called when a task is about to start executing.
+   *
+   * @param id Unique id for the fiber which is starting.
+   */
+  virtual void starting(uintptr_t id) noexcept = 0;
+
+  /**
+   * Called when a task is ready to run.
+   *
+   * @param id Unique id for the fiber which is ready to run.
    */
-  virtual void starting() noexcept = 0;
+  virtual void runnable(uintptr_t id) noexcept = 0;
 
   /**
    * Called just after a task stops executing.
+   *
+   * @param id Unique id for the fiber which is stopping.
    */
-  virtual void stopped() noexcept = 0;
+  virtual void stopped(uintptr_t id) noexcept = 0;
 };
 
 }} // namespace folly::fibers