semvec/pypi-packages huggingface dataset:
pattern-observer 1.0.0
A observer pattern implementation in Python based on jQuery.
License: MIT License
Keywords: observer design pattern

========
Observer
========

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
        :target: https://github.com/fernandojunior/observer/blob/master/LICENSE.rst

.. image:: http://img.shields.io/pypi/v/pattern-observer.svg
        :target: https://pypi.python.org/pypi/pattern-observer

.. image:: https://img.shields.io/pypi/status/pattern-observer.svg
        :target: https://pypi.python.org/pypi/pattern-observer

.. image:: https://img.shields.io/travis/fernandojunior/observer.svg
        :target: https://travis-ci.org/fernandojunior/observer

.. image:: https://img.shields.io/codecov/c/github/fernandojunior/observer.svg
        :target: https://codecov.io/github/fernandojunior/observer

The observer pattern is a software design pattern in which an object, called
the subject, maintains a list of its dependents, called observers, and notifies
them automatically of any state changes, usually by calling one of their
methods [#]_.

The **observer.py** implementation has a topic-based system, a message filtering
type of the publish–subscribe pattern (an observer pattern variation) [#]_.
Therefore, a subject can be subdivided into topics and observers can express
interest in one (or more) topic and only receive notifications (with any
message or not) from that.

The implementation is also based on the jquery publish–subscribe model [#]_
[#]_. So, for convenience, observers will be called **handlers** and topics
will be called **events**. The observer module has only two members: Event and
Observable. An **Observable** instance allows you connect different handlers to
its events. A handler can be any function, method or callable object.

A simpler implementation of the pattern can be found at **old.py**.

References
----------

.. [#] https://en.wikipedia.org/wiki/Observer_pattern
.. [#] https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern
.. [#] http://api.jquery.com/trigger/
.. [#] http://api.jquery.com/on/