|
|
void | _main () |
| | Run the main application or worker loop.
|
| |
|
void | join () |
| | Wait for worker threads owned by the session to exit.
|
| |
| template<class Function , class... Args> |
| auto | push (Function &&newTask, Args &&...args) |
| | Queue work for asynchronous execution.
|
| |
| template<class Function , class X , class Y , class... Args> |
| auto | pushDelayed (Function &&newTask, std::chrono::duration< X, Y > duration, Args &&...args) |
| | Queue a task that becomes runnable after a delay.
|
| |
| void | pushDelayed (std::pair< __time_point, __task > &&task) |
| | Queue a task that becomes runnable after a delay.
|
| |
| void | start (int threads) |
| | Start worker threads for queued thread-pool tasks.
|
| |
|
void | stop () |
| | Stop worker threads and prevent additional task execution.
|
| |
| | ThreadPool (int threads) |
| | Start a pool with the requested number of worker threads.
|
| |
| bool | cancel (task_id_t task_id) |
| | Cancel a queued or delayed task before it runs.
|
| |
| template<class X , class Y > |
| void | delay (task_id_t task_id, std::chrono::duration< X, Y > duration) |
| |
| std::optional< __time_point > | next () |
| | Return the next timer task ready for execution.
|
| |
| TaskPool & | operator= (TaskPool &&other) noexcept |
| | Assign state from another instance while preserving ownership semantics.
|
| |
| std::optional< __task > | pop () |
| | Remove and return the next queued item, waiting when requested.
|
| |
| std::optional< std::pair< __time_point, __task > > | pop (task_id_t task_id) |
| | Remove and return the next queued item, waiting when requested.
|
| |
| template<class Function , class... Args> |
| auto | push (Function &&newTask, Args &&...args) |
| | Queue work for asynchronous execution.
|
| |
| template<class Function , class X , class Y , class... Args> |
| auto | pushDelayed (Function &&newTask, std::chrono::duration< X, Y > duration, Args &&...args) |
| |
| void | pushDelayed (std::pair< __time_point, __task > &&task) |
| | Queue a task that becomes runnable after a delay.
|
| |
| bool | ready () |
| | Check whether the task pool has active workers.
|
| |
| | TaskPool (TaskPool &&other) noexcept |
| | Move queued tasks and timers from another task pool.
|
| |
Allow threads to execute unhindered while keeping full control over the threads.