Skip to main content

python client for discovery a registry for resilient mid-tier load balancing and failover. https://github.com/bilibili/discovery

Project description

# discovery-client

[![CircleCI](https://circleci.com/gh/tomwei7/discovery-client.svg?style=svg)](https://circleci.com/gh/tomwei7/discovery-client)
[![PyPI version](https://badge.fury.io/py/python-discovery-client.svg)](https://badge.fury.io/py/python-discovery-client)

python client for discovery https://github.com/bilibili/discovery only support python3.

### Install

```bash
pip install python-discovery-client
```

### Usage

```python
from discovery import config_from_env, Client


# register instance
client = Client(config_from_env('127.0.0.1:7771')) # use you discovery domain
client.register('your app name', ['http://127.0.0.1:8000'])

# watch instance
def watch_callback(instances):
print('instance change: %s', instances)

client.watch('your app name', watch_callback)

client.stop()
```


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 python-discovery-client, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size python_discovery_client-0.5-py3-none-any.whl (7.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size python-discovery-client-0.5.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View

Supported by

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