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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c505cedbe4fa5302ec285a78106aeca1cc4b821c20947651d8828ba46efbb0 |
|
MD5 | e8142132fb1b2933fe4b26600dc1fc55 |
|
BLAKE2b-256 | 2a931c0d9e5475ed79dabbe705d64d474a72cca95d78dbf71c57eec256b1776b |
Close
Hashes for python_discovery_client-0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5faed61404f02f3fb4278437723bcda8fb28095628fa3dd6d1f523c72af67dd |
|
MD5 | d7f6bd9183455f2265e139d54a6a3a85 |
|
BLAKE2b-256 | 4356b7d49e4ea77194861f8018398c265544ec8623bb7101002502f5e10af3e6 |