快速、简单的对象到对象和广播信号
blinker-alt的Python项目详细描述
[![pypi](https://img.shields.io/pypi/d/v/blinker-alt.svg)](https://pypi.python.org/pypi/blinker-alt) [![pypi](https://img.shields.io/pypi/d/l/blinker-alt.svg)](https://pypi.python.org/pypi/blinker-alt) [![pypi](https://img.shields.io/pypi/d/pyversions/blinker-alt.svg)](https://pypi.python.org/pypi/blinker-alt)
注意:这是[jek/blinker]的叉子(https://github.com/jek/blinker)!
原来的回购协议似乎没有任何活动,最新的变化是 师父并没有被正式释放。所以我分拆了回购协议,合并了几个重要的部分 请求,并以该名称向pypi发布了一个新版本 [闪烁Alt](https://pypi.python.org/pypi/blinker-alt)。
#闪光灯
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)>>> for round in range(1, 4): ... started.send(round) ... Round 1! Round 2! This is round two. Round 3!
有关详细信息,请参阅[blinker文档](https://pythonhosted.org/blinker/)。
##要求
Blinker需要Python2.4或更高版本、Python3.0或更高版本、Jython2.5或更高版本。
##变更日志摘要
1.5(2017年10月15日)
- 降低无操作信号发送的基线成本(可选-o加速)。
- 已验证Python3.6支持(无需更改)。
- 已验证Python3.5支持(无需更改)。
1.4(2015年7月23日)
- 已验证Python3.4支持(无需更改)
- 断开连接处非任何连接的额外簿记清理 时间。
- 添加了信号。_cleanup_bookeping()以清除过时的记帐 需求
1.3(2013年7月3日)
- The global signal stash behind blinker.signal() is now backed by a regular name-to-Signal dictionary. Previously, weak references were held in the mapping and ephemeral usage in code like ^{tt1}$ could have surprising program behavior depending on import order of modules.
- blinker.Namespace is now built on a regular dict. Use blinker.WeakNamespace for the older, weak-referencing behavior.
- Signal.connect(‘text-sender’) uses an alternate hashing strategy to avoid sharp edges in text identity.
1.2(2011年10月26日)
- Added Signal.receiver_connected and Signal.receiver_disconnected per-Signal signals.
- Deprecated the global ‘receiver_connected’ signal.
- Verified Python 3.2 support (no changes needed!)
1.1(2010年7月21日)
- Added ^{tt2}$ decorator
- Added ^{tt3}$ shorthand name for the ^{tt4}$ context manager.
1.0(2010年3月28日)
- Python 3.x compatibility
0.9(2010年2月26日)
- Sphinx docs, project website
- Added ^{tt5}$ support