# Class e.c.u.d.DeferredActionsManager(log.Loggable):

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

def __init__(self):
overrides elisa.core.log.Loggable.__init__
Undocumented
def start(self):
Start processing the actions in a separate thread if it was not already the case.

def stop(self):
Stop processing the actions. The thread is stopped as soon as possible.

def remove_all_actions(self):
Empty the queue of actions.

def enqueue_action(self, action, *args, **kwargs):

    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

def insert_action(self, rank, action, *args, **kwargs):

    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