|
8 | 8 |
|
9 | 9 | ## 历史 |
10 | 10 |
|
11 | | -Python 中的信号解耦机制可以通过 [pydispatcher](http://pydispatcher.sourceforge.net/) 实现。而且 Django Web 框架中的信号机制也是 |
| 11 | +Python 中的信号解耦机制可以通过 [pydispatcher](https://pydispatcher.sourceforge.net/) 实现。而且 Django Web 框架中的信号机制也是 |
12 | 12 | 基于这个项目衍生的。 |
13 | 13 |
|
14 | 14 | 该项目的核心逻辑 ---- 弱引用,也在后来引入到 Python 官方库中。此后该项目也在 2015 年不再更新。 |
15 | 15 |
|
16 | | -而之后社区也出现一些信号框架,和在底层实现类似于 [pydispatcher](http://pydispatcher.sourceforge.net/) 功能的逻辑。 |
| 16 | +而之后社区也出现一些信号框架,和在底层实现类似于 [pydispatcher](https://pydispatcher.sourceforge.net/) 功能的逻辑。 |
17 | 17 |
|
18 | 18 | ## 信号框架 |
19 | 19 |
|
20 | 20 | ### pydispatcher |
21 | 21 |
|
22 | | -[pydispatcher](http://pydispatcher.sourceforge.net/) 提供多生产者-多消费者信号注册和路由基础设施,以在多个上下文中使用。 |
| 22 | +[pydispatcher](https://pydispatcher.sourceforge.net/) 提供多生产者-多消费者信号注册和路由基础设施,以在多个上下文中使用。 |
23 | 23 |
|
24 | 24 | #### pydispatcher 使用示例 |
25 | 25 |
|
@@ -52,13 +52,13 @@ if __name__ == '__main__': |
52 | 52 | 上述示例中 `start_process` 订阅了 `audit` 事件,然后在执行 `ETL.process` 的时候,通过 `dispatcher.send` 一条记录, |
53 | 53 | 同时触发该事件执行。 |
54 | 54 |
|
55 | | -[pydispatcher](http://pydispatcher.sourceforge.net/) 支持指定特定信号,和发送者或匿名。信号可以是特定或者匿名。对象由 Python 解释器 |
| 55 | +[pydispatcher](https://pydispatcher.sourceforge.net/) 支持指定特定信号,和发送者或匿名。信号可以是特定或者匿名。对象由 Python 解释器 |
56 | 56 | 解释器管理,如果对象被回收,则不会在触发。 |
57 | 57 |
|
58 | 58 | ### blinker |
59 | 59 |
|
60 | | -[blinker](https://pythonhosted.org/blinker/) 为Python对象提供快速和简单的对象和广播信号。其内部逻辑依然使用的是弱引用。使用起来和 |
61 | | -[pydispatcher](http://pydispatcher.sourceforge.net/) 类似。 |
| 60 | +[blinker](https://blinker.readthedocs.io/en/stable/) 为Python对象提供快速和简单的对象和广播信号。其内部逻辑依然使用的是弱引用。使用起来和 |
| 61 | +[pydispatcher](https://pydispatcher.sourceforge.net/) 类似。 |
62 | 62 |
|
63 | 63 | #### blinker 使用示例 |
64 | 64 |
|
@@ -97,7 +97,7 @@ if __name__ == '__main__': |
97 | 97 |
|
98 | 98 | ``` |
99 | 99 |
|
100 | | -[blinker](https://pythonhosted.org/blinker/) 同样支持匿名信号,底层的弱引用机制可以减少对象的引用。它有一个好处是支持 |
| 100 | +[blinker](https://blinker.readthedocs.io/en/stable/) 同样支持匿名信号,底层的弱引用机制可以减少对象的引用。它有一个好处是支持 |
101 | 101 | 装饰器订阅事件,使用起来比较方便。 |
102 | 102 |
|
103 | 103 | ### aiosignal |
@@ -146,7 +146,7 @@ if __name__ == '__main__': |
146 | 146 | ```python |
147 | 147 | """ |
148 | 148 | Asyncio pydispatch (Signal Manager) |
149 | | -This is based on [pyDispatcher](http://pydispatcher.sourceforge.net/) reference |
| 149 | +This is based on [pyDispatcher](https://pydispatcher.sourceforge.net/) reference |
150 | 150 | [scrapy SignalManager](https://docs.scrapy.org/en/latest/topics/signals.html) implementation on |
151 | 151 | [Asyncio](https://docs.python.org/3/library/asyncio.html) |
152 | 152 | """ |
|
0 commit comments