Commit d2005259 authored by Anton Likhtarov's avatar Anton Likhtarov Committed by Facebook Github Bot

FiberManager: numTasks() to query for total number of active fibers

Reviewed By: andriigrynenko

Differential Revision: D15366589

fbshipit-source-id: e8d1c17e158437a3ca882f51f12071bf666c1a6e
parent 5284c61b
...@@ -209,6 +209,15 @@ class FiberManager : public ::folly::Executor { ...@@ -209,6 +209,15 @@ class FiberManager : public ::folly::Executor {
*/ */
bool hasTasks() const; bool hasTasks() const;
/**
* @return The number of currently active fibers (ready to run or blocked).
* Does not include the number of remotely enqueued tasks that have not been
* run yet.
*/
size_t numActiveTasks() const noexcept {
return fibersActive_;
}
/** /**
* @return true if there are tasks ready to run. * @return true if there are tasks ready to run.
*/ */
......
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