Class WorkQueue
Defined in File work_queue.hpp
-
class WorkQueue
The WorkQueue class maintains a pool of threads which execute jobs added with the
async()
function.Public Functions
-
explicit WorkQueue(uint32_t threads)
Construct a new work queue
- Parameters
threads – number of worker threads
-
WorkQueue() = delete
-
~WorkQueue()
Destroy the work queue
Enqueue a function to be executed asynchronously by a thread of the pool
- Template Parameters
F – function type
Args – argument types
- Parameters
f – function (can be any callable object)
args – function arguments
- Returns
std::shared_pointer with std::packed_task
-
void stop()
Stop all threads.
-
explicit WorkQueue(uint32_t threads)