A thread pool and queue manager for Jobs.
More...
|
| __init__ (self,(str, int) thread_count="auto") |
| Initialize.
|
|
| add (self, "Job" job) |
| Add a Job to the queue.
|
|
| remove (self, "Job" job) |
| Remove a waiting Job from the queue.
|
|
"JobQueue" | getInstance (cls) |
| Get the singleton instance of the JobQueue.
|
|
|
| _nextJob (self) |
| protected:
|
|
|
| _threads |
|
| _semaphore |
|
| _jobs |
|
| _jobs_lock |
|
A thread pool and queue manager for Jobs.
The JobQueue class manages a queue of Job objects and a set of threads that can take things from this queue to process them.
- See also
- Job
◆ __init__()
UM.JobQueue.JobQueue.__init__ |
( |
|
self, |
|
|
(str, int) |
thread_count = "auto" |
|
) |
| |
Initialize.
- Parameters
-
thread_count | The amount of threads to use. Can be a positive integer or 'auto'. When 'auto', the number of threads is based on the number of processors and cores on the machine. |
◆ add()
UM.JobQueue.JobQueue.add |
( |
|
self, |
|
|
"Job" |
job |
|
) |
| |
Add a Job to the queue.
- Parameters
-
◆ remove()
UM.JobQueue.JobQueue.remove |
( |
|
self, |
|
|
"Job" |
job |
|
) |
| |
Remove a waiting Job from the queue.
- Parameters
-
job | Job The Job to remove. |
- Note
- If a job has already begun processing it is already removed from the queue and thus can no longer be cancelled.
◆ jobFinished
UM.JobQueue.JobQueue.jobFinished = Signal() |
|
static |
Emitted whenever a job has finished processing.
- Parameters
-
job | Job The job that has finished processing. |
◆ jobStarted
UM.JobQueue.JobQueue.jobStarted = Signal() |
|
static |
Emitted whenever a job starts processing.
- Parameters
-
job | Job The job that has started processing. |
The documentation for this class was generated from the following file: