https://github.com/astraluma/aioevents
Events for asyncio
https://github.com/astraluma/aioevents
Last synced: 2 months ago
JSON representation
Events for asyncio
- Host: GitHub
- URL: https://github.com/astraluma/aioevents
- Owner: AstraLuma
- License: mit
- Created: 2014-02-22T01:12:55.000Z (about 11 years ago)
- Default Branch: trunk
- Last Pushed: 2024-01-11T21:09:45.000Z (over 1 year ago)
- Last Synced: 2025-02-02T02:22:26.728Z (3 months ago)
- Language: Python
- Homepage: https://aioevents.readthedocs.io/
- Size: 129 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aioevents
Events for asyncio (PEP 3156)
## Usage
To declare an event:
```python
from aioevents import Eventclass 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)
```