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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65c2d1a4fbe4b540efcee4caee919eb27fd9fc896b232a25b10392cda886c746 |
|
MD5 | ba35646ad61f7d38bffbcca5714c96d3 |
|
BLAKE2b-256 | e0a7cb5e5fe9d39d0847b5c4cf90d83cafa55f62cd567a058e5507cb2142d3be |
Close
Hashes for python_discovery_client-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33579734231b3235eb6bc3cbb8bad2aac354a985ad1ba388aebad029e4010fbc |
|
MD5 | ae5e180c69bf43d7a1a0118623e12197 |
|
BLAKE2b-256 | 46260065372ad08a3b82ff99c26c20fc6dd0c5f0a2254642ad6c909980647f6e |