python client for discovery a registry for resilient mid-tier load balancing and failover. https://github.com/bilibili/discovery
Project description
# discovery-client
python client for discovery https://github.com/bilibili/discovery only support python3.
### Install
```bash
pip install 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()
```
python client for discovery https://github.com/bilibili/discovery only support python3.
### Install
```bash
pip install 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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d272cd7cdf29bb21c400cf68014e1cd860a1fd7ec69cda2dc3512f1562c235 |
|
MD5 | 73c9be57bc8a8014d815e7cb74952517 |
|
BLAKE2b-256 | cfbd3bd1041e87e74608fe144153b78ebc281126795c2d40a92e30e9aabb8cf2 |
Close
Hashes for python_discovery_client-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60197d505f6e4e9166a41bb30d950bf3695e3a5ed31a3d6a9746d58abfb8eb59 |
|
MD5 | 1eb867654d37c261690aed757fb4d3a7 |
|
BLAKE2b-256 | 7f14526ca89e4ea62144125ff6ad90c1bc54101c7be85241d6a7d0516ef3cc87 |