SingletonWorker
¶

-
class
SingletonWorker
(parent=None, name='', queue=None, method=None, cursor=None, sleep=5000, log=30, start=True)[source]¶ Bases:
object
SingletonWorker is used to manage TaurusEmitterThread as Singleton objects
SingletonWorker is constructed using the same arguments than TaurusTreadEmitter ; but instead of creating a QThread for each instance it creates a single QThread for all instances.
The Queue is still different for each of the instances; it is connected to the TaurusEmitterThread signals (next() and somethingDone()) and each Worker queue is used as a feed for the shared QThread.
This implementation reduced the cpu of vacca application in a 50% factor.
Parameters: - parent – a Qt/Taurus object
- name – identifies object logs
- queue – if None parent.getQueue() is used, if not then the queue passed as argument is used
- method – the method to be executed using each queue item as argument
- cursor – if True or QCursor a custom cursor is set while the Queue is not empty