Skip to main content

Vanilla Python client for

Project description

This is an adaptor/plugin for Vanilla based on the python-consul library.

Usage is the same as the standard API except that all API calls return a Vanilla pipe, which can be recv’ed on to receive the Consul response.


h = vanilla.Hub()
c = h.consul()

class Config(object):

config = Config()

def monitor():
    # register our service
        'foo', service_id='foo:1', ttl='10s').recv()

    def keepalive():
        while True:
            # ping our service's health check every 5s

    # maintain our internal configuration state with all available nodes
    # providing the foo service
    index = None
    while True:
        index, nodes =
            'foo', index=index, passing=True).recv()
        config.nodes = [node['Service']['ID'] for node in nodes]

# make use of config.nodes

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 vanilla.consul, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size vanilla.consul-0.2.0.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page