Recommended Python publish/subscribe/dispatch module ?

Posted by Eli Bendersky on Stack Overflow See other posts from Stack Overflow or by Eli Bendersky
Published on 2008-09-22T16:19:16Z Indexed on 2010/04/03 21:23 UTC
Read the original article Hit count: 253

Filed under:

From PyPubSub:

Pypubsub provides a simple way for your Python application to decouple its components: parts of your application can publish messages (with or without data) and other parts can subscribe/receive them. This allows message "senders" and message "listeners" to be unaware of each other:

  • one doesn't need to import the other
  • a sender doesn't need to know
    • "who" gets the messages,
    • what the listeners will do with the data,
    • or even if any listener will get the message data.
  • similarly, listeners don't need to worry about where messages come from.

This is a great tool for implementing a Model-View-Controller architecture or any similar architecture that promotes decoupling of its components.

There seem to be quite a few Python modules for publishing/subscribing floating around the web, from PyPubSub, to PyDispatcher to simple "home-cooked" classes.

Can you recommend a module that works well in most cases ? Which modules have you had positive experience with ? Negative ?

Thanks in advance

© Stack Overflow or respective owner

Related posts about python