Interface for a thread pool.
More...
#include <IThreadPool.hpp>
|
| using | Task = std::function< void()> |
| |
|
| virtual | ~IThreadPool ()=default |
| |
| virtual void | enqueue (Task task)=0 |
| | Enqueue a task to be executed by the thread pool.
|
| |
| virtual void | start ()=0 |
| | Start all threads in the pool.
|
| |
| virtual void | stop ()=0 |
| | Stop all threads and clean up resources.
|
| |
| virtual size_t | size () const =0 |
| | Get the number of threads in the pool.
|
| |
Interface for a thread pool.
Defines the basic API for a thread pool managing multiple worker threads.
Definition at line 22 of file IThreadPool.hpp.
◆ Task
◆ ~IThreadPool()
| virtual server::IThreadPool::~IThreadPool |
( |
| ) |
|
|
virtualdefault |
◆ enqueue()
| virtual void server::IThreadPool::enqueue |
( |
Task |
task | ) |
|
|
pure virtual |
Enqueue a task to be executed by the thread pool.
- Parameters
-
Implemented in server::ThreadPool.
◆ size()
| virtual size_t server::IThreadPool::size |
( |
| ) |
const |
|
pure virtual |
Get the number of threads in the pool.
- Returns
- number of threads
Implemented in server::ThreadPool.
◆ start()
| virtual void server::IThreadPool::start |
( |
| ) |
|
|
pure virtual |
◆ stop()
| virtual void server::IThreadPool::stop |
( |
| ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: