Skip to content
forked from zanson/zkpy

zkpy is a wrapper around Zookeeper's Python library

Notifications You must be signed in to change notification settings

JeremiahDJordan/zkpy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zkpy

zkpy is a wrapper around Zookeeper's Python library, that should provide

Short example:

from __future__ import with_statement
from zkpy.acl import Acls
from zkpy.connection import zkopen, KeeperState, EventType, NodeCreationMode

# define a watcher function
def global_watcher(type, state, path):
    print 'GLOBAL: event=%s, state=%s, path=%s' % (EventType[type], KeeperState[state], path)
    
with zkopen('localhost:2181', 5) as conn:
    # add a connection watcher for fun
    conn.add_global_watcher(global_watcher)
    
    # create a node
    conn.create('/bar','', [Acls.Unsafe], NodeCreationMode.Ephemeral)
    print conn.get_children('/')

Todo:

  • Better zookeeper wrapping (Exceptions, return codes)
  • More recipes
  • Tests
  • Documentation

About

zkpy is a wrapper around Zookeeper's Python library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%