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]
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 |
|---|