Home | Trees | Index | Help |
|
---|
Package kiwi :: Module tasklet :: Class Tasklet |
|
object
--+
|
Tasklet
Method Summary | |
---|---|
Add a callable to be invoked when the tasklet finishes. | |
Dictionary mapping message names to actions ('accept' or 'discard' or 'defer'). | |
Remove a join callback previously added with add_join_callback | |
Method that executes the task. | |
Send a message to be received by the tasklet as an event. | |
Method that should be called when a wait condition fires |
Property Summary | |
---|---|
message_actions |
Instance Variable Summary | |
---|---|
return_value : the value returned by the task function, or None. | |
state : current execution state of the tasklet, one of the STATE_*
contants. |
Class Variable Summary | |
---|---|
int |
STATE_MSGSEND : the tasklet function is currently sending a message |
int |
STATE_RUNNING : the tasklet function is currently executing code |
int |
STATE_SUSPENDED : the tasklet function is currently waiting for an event |
int |
STATE_ZOMBIE : the tasklet function has ended |
Method Details |
---|
add_join_callback(self, callback)Add a callable to be invoked when the tasklet finishes. Return a connection handle that can be used in remove_join_callback() The callback will be called like this:callback(tasklet, retval) where tasklet is the tasklet that finished, and retval its return value (or None). When a join callback is invoked, it is automatically removed, so callingremove_join_callback afterwards produces
a KeyError exception.
|
get_message_actions(self)Dictionary mapping message names to actions ('accept' or 'discard' or 'defer'). Should normally not be accessed directly by the programmer. |
remove_join_callback(self, handle)Remove a join callback previously added withadd_join_callback
|
run(self)Method that executes the task. Should be overridden in a subclass if no generator is passed into the constructor. |
send_message(self, message)Send a message to be received by the tasklet as an event.
|
wait_condition_fired(self, triggered_cond)Method that should be called when a wait condition fires |
Property Details |
---|
message_actions
|
Instance Variable Details |
---|
return_valuethe value returned by the task function, or None. |
statecurrent execution state of the tasklet, one of the STATE_* contants. |
Class Variable Details |
---|
STATE_MSGSENDthe tasklet function is currently sending a message
|
STATE_RUNNINGthe tasklet function is currently executing code
|
STATE_SUSPENDEDthe tasklet function is currently waiting for an event
|
STATE_ZOMBIEthe tasklet function has ended
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Jan 29 16:46:03 2007 | http://epydoc.sf.net |