Events

class piped.event.Event

Bases: object

Very lightweight event handling.

Example:

>>> event = Event()
>>> some_list = list()
>>> def foo(arg):
...     some_list.append(arg)
>>> event += foo
>>> event('42')
>>> event(123)
>>> print some_list
['42', 123]
wait_until_fired(*args, **kwargs)

Returns a defer that fires the next time the event is called.

The Deferred will be callbacked with a two-tuple of (args, kwargs), where args is a list of arguments, and kwargs is a dict of keyword arguments.

Return type:twisted.internet.defer.Deferred

Previous topic

Util

Next topic

Configuration

This Page