Skip to content

Commit

Permalink
Improve Folly thread pool executor documentation for running task
Browse files Browse the repository at this point in the history
Summary:
The expire Callback is not intuitive to understand that it means if the task waittime has expired or the task is running for more than the expiration time

So adding a comment

Reviewed By: Gownta

Differential Revision: D49432292

fbshipit-source-id: e95cd1b589745f0e1145c7b0184c4bc0f49c3a43
  • Loading branch information
Shivanshu Arora authored and facebook-github-bot committed Sep 20, 2023
1 parent 64c8e8d commit bd6873b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions folly/executors/ThreadPoolExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ class ThreadPoolExecutor : public DefaultKeepAliveExecutor {
~ThreadPoolExecutor() override;

void add(Func func) override = 0;
/**
* If func doesn't get started within expiration time after its enqueued,
* expireCallback will be run
*
* @param func Main function to be executed
* @param expiration Maximum time to wait for func to start execution
* @param expireCallback If expiration limit is reached, execute this callback
*/
virtual void add(
Func func, std::chrono::milliseconds expiration, Func expireCallback);

Expand Down

0 comments on commit bd6873b

Please sign in to comment.