A high-performance, simple-structured event system, relies on asyncio
Project description
一个高性能,结构简洁,依赖于 Python内置库asyncio 的事件系统, 设计灵感来自`Graia BroadcastControl <https://github.com/GraiaProject/BroadcastControl>`__。
项目仍处于开发阶段,部分内容可能会有较大改变 ## 安装 ### 从 PyPI 安装
pip install arclet-letoderea
样例
import asyncio
from arclet.letoderea import EventSystem
from arclet.letoderea.entities.event import TemplateEvent
class ExampleEvent(TemplateEvent):
def get_params(self):
return self.param_export(
msg="I'm here!"
)
loop = asyncio.get_event_loop()
es = EventSystem(loop=loop)
@es.register(ExampleEvent)
async def test(msg: str):
print(msg)
async def main():
es.event_publish(ExampleEvent())
await asyncio.sleep(0.1)
loop.run_until_complete(main())
开源协议
本实现以 MIT 为开源协议。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for arclet_letoderea-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc8102ea3f8e3a6e790d378bc221156e385b1019dd2c08710b9f9327f1b4443a |
|
MD5 | 62b931636122e931b7f0882ddcc4fbf9 |
|
BLAKE2b-256 | 65a2a8a74afeff0a5000aa580ad3ae82dba5acc78b21e1f5d6014bead98985e5 |