t.i.b._ThreePhaseEvent(object) : class documentation

Part of twisted.internet.base View Source View In Hierarchy

Collection of callables (with arguments) which can be invoked as a group in a particular order.

This provides the underlying implementation for the reactor's system event triggers. An instance of this class tracks triggers for all phases of a single type of event.

Instance Variable before A list of the before-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments
Instance Variable finishedBefore A list of the before-phase triggers which have already been executed. This is only populated in the 'BEFORE' state.
Instance Variable during A list of the during-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments
Instance Variable after A list of the after-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments
Instance Variable state A string indicating what is currently going on with this object. One of 'BASE' (for when nothing in particular is happening; this is the initial value), 'BEFORE' (when the before-phase triggers are in the process of being executed).
Method __init__ Undocumented
Method addTrigger Add a trigger to the indicate phase.
Method removeTrigger Remove a previously added trigger callable.
Method removeTrigger_BASE Just try to remove the trigger.
Method removeTrigger_BEFORE Remove the trigger if it has yet to be executed, otherwise emit a warning that in the future an exception will be raised when removing an already-executed trigger.
Method fireEvent Call the triggers added to this event.
Method _continueFiring Call the during and after phase triggers for this event.
before =
A list of the before-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments
finishedBefore =
A list of the before-phase triggers which have already been executed. This is only populated in the 'BEFORE' state.
during =
A list of the during-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments
after =
A list of the after-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments
state =
A string indicating what is currently going on with this object. One of 'BASE' (for when nothing in particular is happening; this is the initial value), 'BEFORE' (when the before-phase triggers are in the process of being executed).
def __init__(self): (source)
Undocumented
def addTrigger(self, phase, callable, *args, **kwargs): (source)
Add a trigger to the indicate phase.
ParametersphaseOne of 'before', 'during', or 'after'.
callableAn object to be called when this event is triggered.
*argsPositional arguments to pass to callable.
**kwargsKeyword arguments to pass to callable.
ReturnsAn opaque handle which may be passed to removeTrigger to reverse the effects of calling this method.
def removeTrigger(self, handle): (source)
Remove a previously added trigger callable.
ParametershandleAn object previously returned by addTrigger. The trigger added by that call will be removed.
RaisesValueErrorIf the trigger associated with handle has already been removed or if handle is not a valid handle.
def removeTrigger_BASE(self, handle): (source)
Just try to remove the trigger.
See AlsoremoveTrigger
def removeTrigger_BEFORE(self, handle): (source)
Remove the trigger if it has yet to be executed, otherwise emit a warning that in the future an exception will be raised when removing an already-executed trigger.
See AlsoremoveTrigger
def fireEvent(self): (source)
Call the triggers added to this event.
def _continueFiring(self, ignored): (source)
Call the during and after phase triggers for this event.
API Documentation for Twisted, generated by pydoctor at 2014-05-12 18:27:00.