ThreadWeaver::Queue Class
class ThreadWeaver::QueueQueue implements a ThreadWeaver job queue. More...
Header: | #include <ThreadWeaver/Queue> |
CMake: | find_package(KF6 REQUIRED COMPONENTS ThreadWeaver) target_link_libraries(mytarget PRIVATE KF6::ThreadWeaver) |
Inherits: | ThreadWeaver::QueueSignals |
Public Types
struct | GlobalQueueFactory |
Public Functions
Queue(QObject *parent = nullptr) | |
Queue(ThreadWeaver::QueueSignals *implementation, QObject *parent = nullptr) | |
void | enqueue(const ThreadWeaver::JobPointer &job) |
ThreadWeaver::QueueStream | stream() |
Static Public Members
ThreadWeaver::Queue * | instance() |
void | setGlobalQueueFactory(ThreadWeaver::Queue::GlobalQueueFactory *factory) |
Detailed Description
Queues process jobs enqueued in them by automatically assigning them to worker threads they manage. Applications using ThreadWeaver can make use of a global Queue which is instantiated on demand, or create multiple queues as needed. A job assigned to a queue will be processed by that specific queue.
Worker threads are created by the queues as needed. To create a customized global queue, see GlobalQueueFactory.
See also GlobalQueueFactory, Queue::enqueue(), and Queue::instance().
Member Function Documentation
[explicit]
Queue::Queue(QObject *parent = nullptr)
[explicit]
Queue::Queue(ThreadWeaver::QueueSignals *implementation, QObject *parent = nullptr)
Construct a queue with a customized implementation. The queue takes ownership and will delete the implementation upon destruction.