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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3704a0bd290f8bf6726ad3243391f6ea90c106eb4a5afe7217587dc6aa4d1570 |
|
MD5 | 415ddad904d985b1a5220feac2a57872 |
|
BLAKE2b-256 | f36b05be15d573ebc3e2c0ffae21c27f603407e788e4e3588914abc78a4f5e80 |
Close
Hashes for python_discovery_client-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8946dfb65e95b388c72beec5486ee85878fb348695a82a607abc8188a2fda405 |
|
MD5 | 16e30efc8bd8ae7f0f57fabd6980e2b8 |
|
BLAKE2b-256 | 2e86e9e03f5be5b9bd1c137c88a8b287c9592b00f1c9140113500803894b36c4 |