Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否有考虑添加async的支持? #167

Open
ryanrain2016 opened this issue Jul 9, 2024 · 4 comments
Open

是否有考虑添加async的支持? #167

ryanrain2016 opened this issue Jul 9, 2024 · 4 comments

Comments

@ryanrain2016
Copy link

No description provided.

@CZJCC
Copy link
Collaborator

CZJCC commented Jul 10, 2024

Thank you for suggesting this feature. If you're interested in contributing, we'd warmly welcome a Pull Request with the implementation

@ryanrain2016
Copy link
Author

Thank you for suggesting this feature. If you're interested in contributing, we'd warmly welcome a Pull Request with the implementation

看了下源码,目前代码没有引入任何第三方库,使用的是python自带的http库。没有python自带的http库支持async,加入该特性会引入第三方的库。
另外新的async/await的语法在python 2.7上会报错,如果加入,就不可能支持python 2.7。
感觉原库的设计太多跟线程相关,使用线程池来实现较简单,可以在每个方法上加个转异步的装饰器就可以。但是感觉没有必要,用户自己转就可以,但毕竟不是原生的异步,感觉不太优雅

@CZJCC
Copy link
Collaborator

CZJCC commented Jul 15, 2024

是的,之前有考虑过对gevent、async这些库做适配支持,但确实对老的python版本不兼容,我们需要考虑之前用户的实际情况。另外nacos-python-sdk最近也在对2.x grpc协议适配过程中,到时候会升一个大版本,需不需要对老的python版本进行支持也欢迎社区给出建议~

@CZJCC
Copy link
Collaborator

CZJCC commented Jul 25, 2024

#175 欢迎投票

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants