aioevents-ng-0.0.9
توضیحات
A simple library for managing events through an asynchronous queue
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aioevents-ng-0.0.9 |
| نام | aioevents-ng |
| نسخه کتابخانه | 0.0.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Maxim Pyatishev |
| ایمیل نویسنده | mpyatishev@gmail.com |
| آدرس صفحه اصلی | https://github.com/mpyatishev/aioevents |
| آدرس اینترنتی | https://pypi.org/project/aioevents-ng/ |
| مجوز | - |
=========
aioevents
=========
.. image:: https://travis-ci.com/mpyatishev/aioevents.svg?branch=master
:target: https://travis-ci.com/mpyatishev/aioevents
.. image:: https://codecov.io/gh/mpyatishev/aioevents/branch/master/graph/badge.svg
:target: https://codecov.io/gh/mpyatishev/aioevents
.. image:: https://img.shields.io/pypi/v/aioevents-ng.svg
:target: https://pypi.python.org/pypi/aioevents-ng
A simple library for managing events through an asynchronous queue
Installation
============
.. code:: bash
pip install aioevents-ng
Usage example
=============
.. code:: python
import asyncio
from dataclasses import dataclass
import aioevents
@dataclass
class MyEvent(aioevents.Event):
payload: str
@aioevents.manager.register(MyEvent)
async def event_hadler(event: aioevents.Event):
print(f"recieved: {event}")
async def produce():
async with aioevents.events as events:
await events.publish(MyEvent("Hello!"))
async def main():
aioevents.start(asyncio.get_event_loop())
await produce()
print('stopping worker')
aioevents.stop()
# wait for all coroutines
await asyncio.sleep(1)
if __name__ == "__main__":
asyncio.run(main())
License
=======
``aioevents`` library is offered under Apache 2 license.
نیازمندی
| مقدار | نام |
|---|---|
| >="0.0.2" | aiorecycle |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aioevents-ng-0.0.9:
pip install aioevents-ng-0.0.9.whl
نصب پکیج tar.gz aioevents-ng-0.0.9:
pip install aioevents-ng-0.0.9.tar.gz