对于一个没有使用外部模块的小脚本来说,这个过程可能需要几毫秒的时间。
On a small script with no external modules, the process takes milliseconds.
对于这个示例,有更多的代码需要说明,但与第一个线程示例相比,它并没有复杂多少,这正是因为使用了队列模块。
This example has a bit more code to explain, but it isn't that much more complicated than the first threading example, thanks to the use of the queuing module.
对于announcement模块,这个钩子的实现可能像清单2这样。
A possible implementation of this hook for the announcement module is shown in Listing 2.
应用推荐