Closed Wzzzx closed 1 year ago
Thanks for the suggestion! However, it seems to me that what you're asking for can be achieved simply by editing the thread pool class itself. The code is open source, and the class is fairly short and straightforward, so if you want to execute any custom code as part of the class's logic, you can simply edit the header file and add it on your own. Alternatively, you can change all the private
class members to protected
and derive your own class from it.
Describe the new feature
I would like to request the addition of hook interfaces. These hooks would allow developers to inject custom code logic at various stages, including thread start, thread end, task start, and task end.
The current thread pool library provides efficient thread management and task scheduling, but it lacks the flexibility to execute custom code logic during important stages of thread and task execution. By introducing hook interfaces, developers can have more control over the execution flow and inject their own code at specific points.
Code example
I suggest implementing these hook interfaces as abstract classes or interfaces, which developers can inherit or implement to provide their own custom code logic. It would be helpful to have clear documentation with guidelines and examples to assist developers in effectively utilizing these interfaces.
Additional information
Include any additional information here.