An open API service indexing awesome lists of open source software.

https://github.com/astraluma/aioevents

Events for asyncio
https://github.com/astraluma/aioevents

Last synced: 2 months ago
JSON representation

Events for asyncio

Awesome Lists containing this project

README

        

# aioevents

Events for asyncio (PEP 3156)

## Usage

To declare an event:

```python
from aioevents import Event

class Spam:
egged = Event("The spam has been egged")
```

To register a handler:

```python

spam = Spam()

@spam.egged.handler
def on_egged(sender, amt):
print("Spam got egged {} times".format(amt)")
```

Triggering an event:

```python
spam.egged(42)
```