Skip to main content

Watches a designated node in Zookeeper for data or member changes and trigger a function when an event is detected.

Project description

# Zookeeper-Watcher

Watches a designated node in Zookeeper for data or member changes.
Implements a Watch class which can be used as a decorator to trigger functions when changes are detected on a specified node in Zookeeper.

[![Latest Version](]
[![Download format](]

## Supported Platforms

* OSX and Linux.
* Python 2.7

Probably works with other versions as well.

## Quickstart

pip install Zookeeper-Watcher

from zookeeper_watcher import ZookeeperWatcher

#instantiate the watcher object by passing it the Zookeeper server address and a optional logger.
watcher = ZookeperWatcher('zookeeper_host:port') #can receive also a custom logger by adding logger=some_logger.

#start the async connection with the Zookeeper server

#decorate a function that will be triggered once at runtime and on every detected event
def test_function(children, data):
"""decorated function that receives a list of children nodes of the given path
and a list of data objects (dictionaries) that are read from each child node"""
print "list of children nodes", children
print "list of data objects", data


## Changelog

#### 0.1.4

* Fixed some logging bugs.

#### 0.1.3

* Added custom logging.

#### 0.1.2

* Fixed some logging errors.

#### 0.1.1

* Fixed some distribution packaging bug.

#### 0.1.0

* Initial release.

Project details

Download files

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

Files for Zookeeper-Watcher, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size Zookeeper-Watcher-0.1.4.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page