Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python Client Driver Pool
Python

README.rst

Kiddie Pool - Python Pooling Driver Framework

© 2013 Urban Airship

https://github.com/urbanairship/kiddiepool

https://secure.travis-ci.org/urbanairship/kiddiepool.png?branch=master

Goals

  • Create a reusable connection pool class that handles failover
  • Allow connection pool to discover service locations via Zookeeper

Creating a New Client

Subclass at least KiddieClient to create the public API for your client driver. Should call KiddieClient._sendall(<str>) to send data.

Using the Pool

Using a static pool

  1. Create a list of "<host>:<port>" strings to target for connections.
  2. Instantiate a KiddiePool with that list of strings.
  3. Pass the KiddiePool instance to your KiddieClient subclass for use.
  4. Use your client's API and it will use the pool automatically.

Using a dynamic pool

  1. Instantiate a TidePool with the Zookeeper quorum and znode whose children to monitor.
  2. Use a context manager with TidePool() as pool: or the start() and stop() methods to manage the connection to Zookeeper.
  3. Use the dynamic pool exactly like the static pool. Candidates will be added/removed from the pool by a background thread.
Something went wrong with that request. Please try again.