Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python module implementing the observer pattern using a centralized registry

Project Description

Neo-Observer is a Python module implementing the observer pattern using a centralized registry. You send an event to the registry and it will dispatch the call the registered observers of the event. You can register functions or subclasses of a defined observable interface. Events have a name, a sender and optional info object. You can register an observable to receive an event based on its name, sender or both. Require Python 2.5 and higher (excluding Python 3).

2015-06-05: 1.0.1 Dib push the doc on Github. No more wiki and wiki project. Updated REAME.

2011-04-19: To remove any ambiguity, adding the same observer again cancel the previous registration.

2011-04-19: New improved version

  • Use weak references whenever it is possible. Objects no longer referenced by your code will not receive events so you don’t have to remember to call ‘remove_observer’.
  • Any callable can be used as an observer as long as the callable can be called with the single event argument or without argument at all.
  • When adding an observer, you can specify the method to be called on the observer to receive the event.
  • Implementation changes: Using a type hierarchy instead of a type flag for the different types of observers.

While I was having a centralized registry in mind when I was creating this class, I realize that ObserverRegistry can work in a decentralized way too. Any class derived from ObserverRegistry is an ObserverRegistry too (just don’t forget to call init).

Author: Pierre Thibault (pierre.thibault1 -at- gmail.com)

License: MIT

Project site: https://github.com/Pierre-Thibault/neo-observer

Epydoc documentation: https://pierre-thibault.github.io/neo-observer/

Join the user group: http://groups.google.com/group/neo-users

Release History

Release History

This version
History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
neo_observer-1.0.1-py2-none-any.whl (6.8 kB) Copy SHA256 Checksum SHA256 py2 Wheel Jun 6, 2015
neo-observer-1.0.1.tar.gz (6.2 kB) Copy SHA256 Checksum SHA256 Source Jun 6, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting