starmerx apollo client
Project description
#Starmerx Apollo Client
##项目介绍
本项目是Apollo的Client端, 用来获取Apollo配置。 本项目采用长连接, 保持心跳并从ApolloConfig获取配置 获取配置后, 会备份一本在本地磁盘, 和缓存(不是正经缓存, 就是一个类变量) 配置读取顺序:
- 缓存
- 网络请求
- 本地配置
##使用介绍
使用时建议采用单例模式, 全局使用一个实例, Demo如下:
from starmerx_apollo_client.apollo_client import ApolloClient from utils.env import env
CONFIG_URL = env.get_value('APOLLO_CONFIG_URL', default='') APP_ID = env.get_value('APOLLO_APP_ID', default='') APP_SECRET = env.get_value('APOLLO_APP_SECRET', default='')
a_client = ApolloClient(app_id=APP_ID, secret=APP_SECRET, config_url=CONFIG_URL)
##遗留问题
暂只支持python3 长链接那里目前使用没有问题, 后续需要跟进
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starmerx_apollo_client-0.0.3.tar.gz.
File metadata
- Download URL: starmerx_apollo_client-0.0.3.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be137f0e7d56436a2c674698cf490b3122702dc3433a416a8ee9affcb24d969d
|
|
| MD5 |
52aaf1a1e2f51132f9bf966199ba4f06
|
|
| BLAKE2b-256 |
b62233f3415484a5fd44a428d97731be8e27c7016006cab919c2c6def4e48aea
|
File details
Details for the file starmerx_apollo_client-0.0.3-py3-none-any.whl.
File metadata
- Download URL: starmerx_apollo_client-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c056d329491759cacb77d15ea68d7eb31098a1e354609c9f81991a158e906eb
|
|
| MD5 |
b39fddcce26ea02212ef1bb6ab797f5a
|
|
| BLAKE2b-256 |
6385b6e00aa33a929e04cdbdc27b92576d3b38a4bffa1f21147295d4c73a2931
|