qubx :: task :: Homunculus :: Class Homunculus
[hide private]
[frames] | no frames]

Class Homunculus

source code

object --+    
         |    
      Task --+
             |
            Homunculus
Known Subclasses:

A worker thread which services a queue of callables.

Instance Methods [hide private]
 
__init__(self, label, on_start_item=<function <lambda> at 0xd008f7c>, on_finish_item=<function <lambda> at 0xd008fb4>)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
interrupt(self)
Raises KeyboardInterrupt in the Task thread, only if it's running something.
source code
 
stop(self)
Causes the Task thread to stop servicing and terminate after finishing the current item, if any.
source code
 
do(self, *argv, **kw)
Enqueues argv[0](*argv[1:], **kw).
source code
 
run(self)
Override this method to make the Task thread do something.
source code

Inherited from Task: __call__, gui_call_recv, join, send_exception, send_progress, send_result, send_status, set_progress, set_status, start, thread_main

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]

Inherited from Task: OnException, OnInterrupt, OnProgress, OnResult, OnStatus, OnTerminate, label, main_hold, progress, status, tid

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, label, on_start_item=<function <lambda> at 0xd008f7c>, on_finish_item=<function <lambda> at 0xd008fb4>)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

interrupt(self)

source code 

Raises KeyboardInterrupt in the Task thread, only if it's running something.

Overrides: Task.interrupt

do(self, *argv, **kw)

source code 

Enqueues argv[0](*argv[1:], **kw). For example:

>>> myHomunculus.do(sys.stdout.write, 'Hello world')

causes this to happen in the Task thread:

>>> sys.stdout.write('Hello world')

run(self)

source code 

Override this method to make the Task thread do something.

Overrides: Task.run
(inherited documentation)