1. 首页
  2. 数据库
  3. 其它
  4. blinker:快速的Python进程内信号事件分配系统 源码

blinker:快速的Python进程内信号事件分配系统 源码

上传者: 2021-04-08 22:23:47上传 ZIP文件 28.46KB 热度 5次
信号灯 Blinker提供了一种快速调度系统,该系统允许任意数量的感兴趣的方订阅事件或“信号”。 信号接收方可以订阅特定的发送方,也可以接收任何发送方发送的信号。 它支持分派到连接的协程和接收器函数的任意混合。 >> > from blinker import signal >> > started = signal ( 'round-started' ) >> > def each ( round ): ... print "Round %s!" % round ... >> > started . connect ( each ) >> > def round_two ( round ): ... print "This is round two." ... >> > started . connect ( round_two , sender = 2 ) >>
下载地址
用户评论