ThreadWeaver
job.h
35 * It is essential for the ThreadWeaver library that as a kind of convention, the different creators of Job objects do not touch
38 * Jobs may not be executed twice. Create two different objects to perform two consecutive or parallel runs.
41 * Jobs may declare dependencies. If Job B depends on Job A, B may not be executed before A is finished. To learn about
44 * Job objects do not inherit QObject. To connect to signals when jobs are started or finished, see QObjectDecorator.
59 * Whenever the currently executed job is communicated to the outside world, use the supplied job pointer
62 * job is the Job that the queue is executing. It is not necessarily equal to this. For example, Jobs that are
72 * Returns the previously set executor. The executor can never be unset. If zero is passed in as the new executor, the Job
81 * Jobs will be sorted by their queueing priority when enqueued. A higher queueing priority will place the job in front of all
84 * Note: A higher or lower priority does not influence queue policies. For example, a high-priority job that has an unresolved
85 * dependency will not be executed, which means an available lower-priority job will take precedence.
87 * The default implementation returns zero. Only if this method is overloaded for some job classes, priorities will influence
103 * The default implementation simply returns true. Overload in derived classes if the derived Job class can fail.
105 * If a job fails (success() returns false), it will *NOT* resolve its dependencies when it finishes. This will make sure that
108 * There is an important gotcha: When a Job object it deleted, it will always resolve its dependencies. If dependent jobs should
109 * not be executed after a failure, it is important to dequeue those before deleting the failed Job. A Sequence may be
116 * Call this method to ask the Job to abort if it is currently executed. Default implementation of the method sets a flag
117 * causing `shouldAbort()` return true. You can reimplement this method to actually initiate an abort action.
119 * This method is supposed to return immediately, not after the abort has completed. It requests the abort, the Job has to act on
137 * The job will be added right after this method finished. The default implementation does nothing. Use this method to, for
140 * Note: When this method is called, the associated Weaver object's thread holds a lock on the weaver's queue. Therefore, it
151 * The job will be removed from the queue right after this method returns. Use this method to dequeue, if necessary,
154 * Note: When this method is called, the associated Weaver object's thread does hold a lock on the weaver's queue.
174 * Queue Policies customize the queueing (running) behaviour of sets of jobs. Examples for queue policies are dependencies
175 * and resource restrictions. Every queue policy object can only be assigned once to a job, multiple assignments will be
200 * The Job will be executed in the specified thread. thread may be zero, indicating that the job is being executed some
201 * other way (for example, synchronously by some other job). self specifies the job as the queue sees it. Whenever publishing
202 * information about the job to the outside world, for example by emitting signals, use self, not this. self is the reference
203 * counted object handled by the queue. Using it as signal parameters will amongst other things prevent thejob from being
211 * job is the Job that the queue is executing. It is not necessarily equal to this. For example, Jobs that are
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition job.h:47
void run(JobPointer self, Thread *thread) override=0
The method that actually performs the job.
QueuePolicy is an interface for customizations of the queueing behaviour of jobs.
Definition queuepolicy.h:39
Q_SCRIPTABLE CaptureState status()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.