ThreadWeaver 5.109.0
Signals | Public Member Functions | Protected Member Functions | List of all members
ThreadWeaver::QueueSignals

QueueSignals declares the Qt signals shared by the Queue and Weaver classes. More...

#include <queuesignals.h>

Signals

void finished ()
 Emitted when the Queue has completed all jobs currently queued.
 
void stateChanged (ThreadWeaver::State *)
 Emitted when the processing state of the Queue has changed.
 
void suspended ()
 The Queue has been suspended.
 

Public Member Functions

 QueueSignals (QObject *parent=nullptr)
 
 QueueSignals (ThreadWeaver::Private::QueueSignals_Private *d, QObject *parent=nullptr)
 
- Public Member Functions inherited from ThreadWeaver::QueueInterface
virtual int currentNumberOfThreads () const =0
 Returns the current number of threads in the inventory.
 
virtual void dequeue ()=0
 Remove all queued jobs.
 
virtual bool dequeue (const JobPointer &job)=0
 Remove a job from the queue.
 
virtual void enqueue (const QVector< JobPointer > &jobs)=0
 Queue a vector of jobs.
 
virtual void finish ()=0
 Finish all queued operations, then return.
 
virtual bool isEmpty () const =0
 Is the queue empty? The queue is empty if no more jobs are queued.
 
virtual bool isIdle () const =0
 Is the weaver idle? The weaver is idle if no jobs are queued and no jobs are processed by the threads.
 
virtual int maximumNumberOfThreads () const =0
 Get the maximum number of threads this Weaver may start.
 
virtual int queueLength () const =0
 Returns the number of pending jobs.
 
virtual void requestAbort ()=0
 Request aborts of the currently executed jobs.
 
virtual void reschedule ()=0
 Reschedule the jobs in the queue.
 
virtual void resume ()=0
 Resume job queueing.
 
virtual void setMaximumNumberOfThreads (int cap)=0
 Set the maximum number of threads this Weaver object may start.
 
virtual void shutDown ()=0
 Shut down the queue.
 
virtual const Statestate () const =0
 Return the state of the weaver object.
 
virtual void suspend ()=0
 Suspend job execution.
 

Protected Member Functions

ThreadWeaver::Private::QueueSignals_Private * d ()
 
const ThreadWeaver::Private::QueueSignals_Private * d () const
 

Detailed Description

QueueSignals declares the Qt signals shared by the Queue and Weaver classes.

Member Function Documentation

◆ finished

void ThreadWeaver::QueueSignals::finished ( )
signal

Emitted when the Queue has completed all jobs currently queued.

The Queue emits finished() when the job queue is empty, and the last job currently processed by a worker threads was completed. Beware that if multiple jobs are enqueued repeatedly one by one, this signal might be emitted multiple times, because the queued jobs where processed before new ones could be queued. To avoid this, queue all relevant jobs in a single operation, using for example a QueueStream or a Collection.

◆ stateChanged

void ThreadWeaver::QueueSignals::stateChanged ( ThreadWeaver::State )
signal

Emitted when the processing state of the Queue has changed.

◆ suspended

void ThreadWeaver::QueueSignals::suspended ( )
signal

The Queue has been suspended.

When the Queue is suspended, worker threads will not be assigned new jobs to process. Jobs waiting in the queue will not be started until processing is resumed. When suspend() is called, the worker threads will continue to process the job currently assigned to them. When the last thread finishes it's current assignment, suspended() is emitted.

See also
suspend()