bruceww / pyapollo Goto Github PK
View Code? Open in Web Editor NEWThis project forked from filamoon/pyapollo
Python client for Ctrip's Apollo.
License: Apache License 2.0
This project forked from filamoon/pyapollo
Python client for Ctrip's Apollo.
License: Apache License 2.0
近期很多同学对该项目提出了一些改进建议,在这里非常感谢各位同学的肯定。
同时发现各位同学向pypi上提交了几个类似的项目,容易给其他同学造成困扰,
现诚邀各位有兴趣加入的同学一起维护这个项目,以提升项目的活跃性,并不断完善项目。
请有兴趣加入的同学在下方留言,我会邀请大家加入项目维护组,并配置pypi相应权限,方便大家发布优化的版本。
——林洛
15869300264
(微信、163邮箱同上)
而不仅仅是通过key获取值, 多谢
请教下你这个是如何实时感知apollo配置的变化的?
或者具体体现在代码的什么地方?我看到的是代码里面好像一直在请求。
非常感谢!
问题描述:getConfig的时候,传入的namespace不存在,程序会block住。
问题解释:apollo在获取配置动态更新的时候,会传namespace名称和notificationId,但是当namespace不存在的时候,后台会忽略这个namespace,然后阻塞住,但是前端get的时候,就被阻塞了。
>>> client = ApolloClient(app_id="default", config_server_url="http://127.0.0.1:8090", cycle_time=10)
>>> client.start()
# apollo目前hello的值为world
>>> print(client.get_value("hello"))
# world
# 修改hello的值为apollo
>>> time.sleep(20)
>>> print(client.get_value("hello"))
# world
Q1: 在111行 _get_namespaces 请求的接口f"{self.host}:{self.port}/apps/{self.app_id}/clusters/{self.cluster}/namespaces", 该接口实际是Adminservice提供的接口。 Apollo客户端不应该是要去请求ConfigService么?
Q2: 为什么不采用https://github.com/ctripcorp/apollo/wiki/%E5%85%B6%E5%AE%83%E8%AF%AD%E8%A8%80%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97 官方推荐方式来感知配置更新
目前该版本的py代码,并没有 APOLLO_ACCESSKEY_SECRET 功能
在本地执行可以成功,达成docker镜像之后镜像无法启动,报错如下:
File "/usr/local/lib/python3.8/site-packages/pyapollo/apollo_client.py", line 95, in init
self._path_checker()
File "/usr/local/lib/python3.8/site-packages/pyapollo/apollo_client.py", line 222, in _path_checker
os.mkdir(self._cache_file_path)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/pyapollo/config'
_get_namespaces
返回的结果不是 json 了,是需要添加 authorization 参数嘛?A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.