Part of elisa.core.utils.deferred_action View In Hierarchy
Manage a queue of actions (callables), and execute them sequentially in a single thread.
This is very inefficiant and should not be used anymore!
WARNING: It is NOT thread-safe.Line # | Kind | Name | Docs |
---|---|---|---|
41 | Method | __init__ | Undocumented |
51 | Method | start | Start processing the actions in a separate thread |
61 | Method | stop | Stop processing the actions. The thread is stopped as soon as possible. |
68 | Method | remove_all_actions | Empty the queue of actions. |
76 | Method | enqueue_action | Add an action at the end of the queue. It will be processed when all the previous |
104 | Method | insert_action | FIXME, DOCME: wrong documentation copied/pasted from enqueue_action |
134 | Method | _main_loop | Process all the actions in the queue sequentially. |
151 | Method | _execute_task | Process a single action. |
Add an action at the end of the queue. It will be processed when all the previous actions in the queue have finished. If no actions are being processed, it starts processing automatically. WARNING: The program will not stop until the current task has finished. :parameters: `action` : callable Action to be executed `args` : list Arguments passed to the action `kwargs` : dictionary Keywords arguments passed to the action :return: Deferred object used to chain success and error callbacks :rtype: twisted.internet.defer.Deferred
FIXME, DOCME: wrong documentation copied/pasted from enqueue_action Add an action at the end of the queue. It will be processed when all the previous actions in the queue have finished. If no actions are being processed, it starts processing automatically. WARNING: The program will not stop until the current task has finished. :parameters: `action` : callable Action to be executed `args` : list Arguments passed to the action `kwargs` : dictionary Keywords arguments passed to the action :return: Deferred object used to chain success and error callbacks :rtype: twisted.internet.defer.Deferred