An object that launches and manages a tasklet.
Function | __init__ | Launch a generator tasklet. |
Function | start | Starts the execution of the task, for use with tasklets |
Function | get_message_actions | Dictionary mapping message names to actions ('accept' or |
Function | run | Method that executes the task. |
Function | _invoke | Undocumented |
Function | _next_round | Undocumented |
Function | _dispatch_message | get next message that a tasklet wants to receive; discard |
Function | _update_wait_conditions | disarm wait conditions removed and arm new wait conditions |
Function | wait_condition_fired | Method that should be called when a wait condition fires |
Function | add_join_callback | Add a callable to be invoked when the tasklet finishes. |
Function | remove_join_callback | Remove a join callback previously added with add_join_callback |
Function | _join | Undocumented |
Function | send_message | Send a message to be received by the tasklet as an event. |
Launch a generator tasklet.
Starts the execution of the task, for use with tasklets created with start=False
Dictionary mapping message names to actions ('accept' or 'discard' or 'defer'). Should normally not be accessed directly by the programmer.
Method that executes the task.
Should be overridden in a subclass if no generator is passed into the constructor.
get next message that a tasklet wants to receive; discard messages that should be discarded
disarm wait conditions removed and arm new wait conditions
Method that should be called when a wait condition fires
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, *extra_args)
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 calling remove_join_callback afterwards produces a KeyError exception.
Remove a join callback previously added with add_join_callback
Send a message to be received by the tasklet as an event.