threads.threads#
Thread definitions and associated worker classes.
Classes:
|
Base QThread controller. |
|
Used to signify the end of a data type. |
Functions:
|
Adds a wekref item to the worker's queue. |
|
Get a cached thread controller instance. |
|
Returns a queue associated with a thread. |
|
A utility method used to execute a delayed database transaction. |
Terminate all running threads. |
|
Clear all thread queues. |
- class bookmarks.threads.threads.BaseThread(worker, parent=None)[source]#
Bases:
QThread
Base QThread controller.
- initWorker#
Signal emitted when the thread has spun up.
- Type:
QtCore.Signal
- startTimer#
Starts the thread’s queue timer.
- Type:
QtCore.Signal
- stopTimer#
Stops the thread’s queue timer.
- Type:
QtCore.Signal
Methods:
Slot called when the thread is started.
Attributes:
startTimer
(*args, **kwargs)- move_worker_to_thread()[source]#
Slot called when the thread is started.
We’ll move the worker to the thread and connect all signals needed to communicate with the worker.
- startTimer(*args, **kwargs)#
- class bookmarks.threads.threads.DataType(q, t)[source]#
Bases:
object
Used to signify the end of a data type.
- bookmarks.threads.threads.add_to_queue(k, ref)[source]#
Adds a wekref item to the worker’s queue.
- Parameters:
ref (weakref.ref) – A weak reference to a data segment.
end (bool) – Add to the end of the queue instead if True.
- bookmarks.threads.threads.get_thread(k)[source]#
Get a cached thread controller instance.
- Parameters:
k (str) – Name of the thread controller to return, e.g.
threads.QueuedShotgunQuery
.
If the controller does not yet exist we will create and cache it. All threads are associated with worker, defined by THREADS.