Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`internet`.`base`.`_ThreePhaseEvent``

class documentation

`class _ThreePhaseEvent: (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.

Method | `__init__` | Undocumented
Method | `addTrigger` | Add a trigger to the indicate phase.
Method | `fireEvent` | Call the triggers added to this event.
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.
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 | `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 | `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 | `finishedBefore` | A list of the before-phase triggers which have already been executed. This is only populated in the `'BEFORE'` state.
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 | `_continueFiring` | Call the during and after phase triggers for this event.

def __init__(self): (source)

Undocumented

def addTrigger(self, phase, callable, *args, **kwargs): (source)

Add a trigger to the indicate phase.

Parameters
phase:`str` | One of `'before'`, `'during'`, or `'after'`.
callable:`_ThreePhaseEventTriggerCallable` | An object to be called when this event is triggered.
*args:`object` | Positional arguments to pass to `callable`.
**kwargs:`object` | Keyword arguments to pass to `callable`.
Returns
`_ThreePhaseEventTriggerHandle` | An opaque handle which may be passed to `removeTrigger` to reverse the effects of calling this method.

def fireEvent(self): (source)

Call the triggers added to this event.

def removeTrigger(self, handle): (source)

Remove a previously added trigger callable.

Parameters
handle:`_ThreePhaseEventTriggerHandle` | An object previously returned by `addTrigger`. The trigger added by that call will be removed.
Raises
`ValueError` | If 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.

Parameters
handle:`_ThreePhaseEventTriggerHandle` | Undocumented
See Also
removeTrigger

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.

Parameters
handle:`_ThreePhaseEventTriggerHandle` | Undocumented
See Also
removeTrigger

after: `List[_ThreePhaseEventTrigger]` = (source)

A list of the after-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments

before: `List[_ThreePhaseEventTrigger]` = (source)

A list of the before-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments

during: `List[_ThreePhaseEventTrigger]` = (source)

A list of the during-phase triggers containing three-tuples of a callable, a tuple of positional arguments, and a dict of keyword arguments

finishedBefore: `list` = (source)

A list of the before-phase triggers which have already been executed. This is only populated in the `'BEFORE'` state.

state: `str` = (source)

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 _continueFiring(self, ignored): (source)

Call the during and after phase triggers for this event.

Parameters
ignored:`object` | Undocumented