Skip to main content

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.

Example

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

class Config(object):
    pass

config = Config()

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

    @h.spawn
    def keepalive():
        while True:
            # ping our service's health check every 5s
            c.health.check.ttl_pass('service:foo:1').recv()
            h.sleep(5000)

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

# make use of config.nodes

Installation

pip install vanilla.consul

Metadata

Release files for vanilla.consul 0.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vanilla.consul 0.4.7
File Size Uploaded Provenance Actions
vanilla.consul-0.4.7.tar.gz 2.7 kB Without provenance Details for vanilla.consul-0.4.7.tar.gz

Release files / vanilla.consul-0.4.7.tar.gz

Download URL vanilla.consul-0.4.7.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d863d1369ad67da2f5a282ec60734955e84198a4edbaa8329b83883b90267f7
BLAKE2b-256 checksum
How to use checksums
0929b3e56b5f0630cd9169ef1c99649721a74fbf71baec33f8e5b845783373d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for vanilla.consul 0.4.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page