Ignore changes in the amount of whitespace
Differences between version dated 2005-08-15 12:11:03 and 2005-08-15 12:12:40
Deletions are marked like this.
Additions are marked like this.
The ``canceller`` object is a reference to our subscription, once the
reference is lost our subscrition os lost too. We can cancel our
reference is lost our subscription is lost too. We can cancel our
subscription explicitly by calling the ``canceller`` object.
The output would be:
=== Another Event Source ===
Two event sources are called ``Distributor`` and ``Broadcaster``. An event
source it's what you have to subscribe to listen for the events they send.
source is what you have to subscribe to listen for the events they send.
The difference between ``Distributor`` and a ``Broadcaster`` is a very simple
one. You may assign more then one listener (or callback) to an event source.
When the event source generates a given event it will iterate over it's
listeners, by the order they were subscribed, and send the event to each
one. In the case of a ``Distributer`` when one of its listeners returns
``True`` the iteration stops.
When the event source generates a given event, it will iterate over its
listeners in the order in which they were subscribed and send the event to each
one. In the case of a ``Distributer``, when one of its listeners returns
``True``, the iteration stops.