Pyeventbus异步事件处理框架
Pyeventbus是个十分轻巧的异步事件处理框架。
特性:
-
Pyeventbus 会检查你的事件消息类型和侦听器的类型的合法性,侦听器和消息需要被正确的创建
-
允许一个事件消息有多个对应的处理方法,事件处理的时间复杂度是O(k)的,取决于你的侦听处理函数有多少个
-
支持同步和异步事件处理,可自定义异步事件处理线程池大小
示例代码:
from eventbus.eventbus import EventBus #now create a eventbus,the default pool size is 4 and isdaemon is true eventbus=EventBus() #add the listener to eventbus so it will use the right handler to process the event eventbus.register(Listener()) #now the event message were sent,eventbus will process #this is for the async post eventbus.async_post(GreetEvent()) #this is for the sync post eventbus.post(GreetEvent()) #remove the listener eventbus.unregister(Listener()) #destroy the eventbus eventbus.destroy()
评论
ParSeqJava 异步处理框架
ParSeq是一个简化Java编写异步处理代码的框架,优点:异步操作的并行处理顺序执行非堵塞计算通过任务组合实现代码的重用简单的错误传播和恢复执行跟踪和可视化示例代码:import com.linke
ParSeqJava 异步处理框架
0
libevent异步事件处理库
libevent是一个异步事件处理软件函式库,以BSD许可证释出。libevent提供了一组应用程序编程接口(API),让程式设计师可以设定某些事件发生时所执行的函式,也就是说,libevent可以用
libevent异步事件处理库
0
MTControlios 事件处理
MTControl给iOS的UIControl对象附加了类似jQuery风格的事件处理。示例代码:UIButton*button=[UIButtonbuttonWithType:UIButtonTyp
MTControlios 事件处理
0