Events for asyncio (PEP 3156)
To declare an event:
from aioevents import Event
class Spam:
egged = Event("The spam has been egged")
To register a handler:
spam = Spam()
@spam.egged.handler
def on_egged(sender, amt):
print("Spam got egged {} times".format(amt)")
Triggering an event:
spam.egged(42)