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()
```
[![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.
Source Distribution
Built Distribution
Close
Hashes for python-discovery-client-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f61926819f05b9787eaecea514c74b47736b3afc2022bfaf6d2106138930a5b |
|
MD5 | 0865de0fc18559c009647f8e0a026f6c |
|
BLAKE2b-256 | 78d983cc1fe87eba5edad4bddaaa1ff22fe0f3e5e6cfa378042b6d0574f19302 |
Close
Hashes for python_discovery_client-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b54807f5eb1f48369a5cf638ab14e775aeb93e82ac49b0f7b34d151ad941436 |
|
MD5 | d3afb3568ff37f3bb15991086e91f53a |
|
BLAKE2b-256 | f797877172f099e5ce0cae182ee8e1c73b2c3065459208b3e636d0dba96b56c2 |