极其轻松的事件发射器。发布子实现。

eeee的Python项目详细描述


Info:Extremely Easy Event Emitter.
Author:Paweł Zadrożny @pawelzny <pawel.zny@gmail.com>
CI StatusDocumentation StatusPyPI Repository StatusRelease StatusProject StatusSupported python versionsSupported interpretersLicense

功能

  • 基于asyncio的异步事件发射器
  • 订阅任何可调用的处理程序
  • 按发布者筛选事件
  • 在运行时轻松启用禁用事件
  • 使用decorator订阅处理程序

安装

pip install eeee

https://pypi.org/project/eeee/

文档

阅读http://eeee.readthedocs.io/en/stable/上的完整文档

快速示例

fromeeeeimportEvent,Publishermy_event=Event('MyEvent')# Subscribe takes publisher instance or name as optional argument.# If publisher is defined handler will be triggered only when that# particular publisher send a message.# Leave empty to listen to all publishers within this event.@my_event.subscribe()asyncdefcustom_handler(message,publisher,event):print(message,publisher,event)result=awaitmy_event.publish('New message arrived!',Publisher('global'))

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java HikariCP连接池Tomcat调试启用   java如何在javascript中访问JSON数组的元素?   jasper使用HttpServlet报告Java空白PDF   用于存储海量数据的java最佳集合   JBPM&springboot组织。流口水。坚持不懈jta。JtaTransactionManager在JNDI位置[java:comp/UserTransaction]未找到任何UserTransaction   java Grails maven插件需要Groovy 2.4.2   获取列表中访问最少的元素(Java 8)   java在IntelliJ中下载cn1lib不起作用   java Akka构造函数通过spring进行布线   swing在Java中创建JList时,如何更改条目的背景颜色?   为什么Java8Lambda允许访问非最终类变量?   javajavax。邮政MessaginException:无法连接到SMTP主机   java Android Webview高度在滚动后增加