| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
sip.wrapper --+
|
PyQt4.QtCore.QObject --+
|
PyQt4.QtCore.QThread --+
|
Threadlet
Threadlet - execute a function in a seperate thread
Use this class to run a CPU or I/O bound function in a seperate thread.>>> def pow(x, y): return x**y >>> def printer(r): print r >>> parent.example = Threadlet() >>> parent.connect(parent.example, SIGNAL('done(result)'), printer) >>> parent.example.detach(pow, 2, 6)Signals emitted:
Emits Qt Signal (finished()): Signal is emitted when the thread has finished.
Emits Qt Signal (terminated()): Signal is emitted when the thread is terminated.
Emits Qt Signal (started()): Signal is emitted when the thread starts executing.
Warning: The function and all applied arguments must be thread safe!
|
|||
|
Inherited from |
|||
|
|||
|
__init__(self,
parent=None) Constructor |
||
|
clear(self) Clear variables |
||
|
detach(self,
obj,
*args,
**kwargs) Detach a function call |
||
|
run(self) Payload - runs the callable and emits done(result) |
||
|
Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
Clear variables Mutex must be locked before clear() is called from a method! |
|
Payload - runs the callable and emits done(result) The function and its args/kwargs are cleared after the function has run to avoid cyclic references.
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0alpha3 on Sun Feb 4 17:00:23 2007 | http://epydoc.sourceforge.net |