<p>这可能会明确Pubsub与信号的关系:<a href="http://pubsub.sourceforge.net/apidocs/concepts.html" rel="nofollow">http://pubsub.sourceforge.net/apidocs/concepts.html</a></p>
<blockquote>
<p>Pubsub facilitates the decoupling of components (callables, modules, packages) within an application. It does this by:</p>
<ul>
<li>Allowing parts of the application to send messages to “the rest of the application” without having to know
<ul>
<li><em>if</em> the messages will be handled:
<ul>
<li>perhaps the message will be ignored completely,</li>
<li>or handled by a many different parts of the application;</li>
</ul></li>
<li><em>how</em> the messages will be handled:
<ul>
<li>what will be done with the message and its contents;</li>
<li>in what order any given message will be sent to the rest of the application;</li>
</ul></li>
</ul></li>
<li>Allowing parts of the application to receive and handle messages from “the rest of the application” without having to know who sent the messages.</li>
</ul>
<p>A listener is “a part of the application that wants to receive messages”. A listener subscribes to one or more topics. A sender is any part of the application that asks Pubsub to send a message of a given topic. The sender provides data, if any. Pubsub will send the message, including any data, to all listeners of the message’s topic.</p>
</blockquote>