>One feature that I like with pubsub is the concept of 'topics' and,
>especially, the hierarchical nature of topics as supported by pubsub.
>
>
I can see how such a thing might be interesting, but can you give a
concrete use-case example for it? I'm guessing something like "capture
all 'mouse' events" versus "capture 'mouse-down' events"? Might be
useful add-on for PyDispatcher (which, btw, is Patrick's creation, I
just helped with packaging it up). Would have to give some
thought as
to the restrictions that it would place on the "signal" object before
implementing it as default, though.
E.g., in my application I have a hierarchical document, a view, and an
"import reader" (this imports some data from a database, it is not the same
operation as opening a document, which just creates a new document). When
the user changes something in the view, say data in a text control box, the
view commits the data to a leaf in the hierarchy of the document and
generates a message for '(doc, changed, fromView)' topic, in case 'someone'
is interested in the fact that document has been changed. Similarly, the
import reader generates a message for topic '(doc, changed, fromImport)'
when it imports some external data into some leaves of an existing document.
The document needs to know when one of its leaves has been changed by
external agents, but it doesn't care how or for what reason, so it is
subscribed to the more general '(doc, changed)' topic. This is more than
just a convenience: the document doesn't need to know how many different
ways of changing its leaves are possible in the running environment.
Oliver