threads.threads#

Thread definitions and associated worker classes.

Classes:

BaseThread(worker[, parent])

Base QThread controller.

DataType(q, t)

Used to signify the end of a data type.

Functions:

add_to_queue(k, ref)

Adds a wekref item to the worker's queue.

get_thread(k)

Get a cached thread controller instance.

queue(k)

Returns a queue associated with a thread.

queue_database_transaction(*args)

A utility method used to execute a delayed database transaction.

quit_threads()

Terminate all running threads.

reset_all_queues()

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:

move_worker_to_thread()

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.

bookmarks.threads.threads.queue(k)[source]#

Returns a queue associated with a thread.

bookmarks.threads.threads.queue_database_transaction(*args)[source]#

A utility method used to execute a delayed database transaction.

bookmarks.threads.threads.quit_threads()[source]#

Terminate all running threads.

bookmarks.threads.threads.reset_all_queues()[source]#

Clear all thread queues.