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

useAsync 里面添加拉取,是出于什么考虑? #63

Closed
DiamondYuan opened this issue Sep 20, 2019 · 2 comments
Closed

useAsync 里面添加拉取,是出于什么考虑? #63

DiamondYuan opened this issue Sep 20, 2019 · 2 comments

Comments

@DiamondYuan
Copy link
Contributor

No description provided.

@ttys026
Copy link
Collaborator

ttys026 commented Sep 20, 2019

这里的拉取是指轮询吗?
在中后台场景下,websocket 的使用并不普及,轮询还是一个比较常用的处理方法。比如查询一个项目的构建状态,预案执行的情况等等。所以直接在 useAsync 里内置了定时器,希望能最大程度上降低业务代码逻辑的复杂度。

@DiamondYuan
Copy link
Contributor Author

这里的拉取是指轮询吗?
在中后台场景下,websocket 的使用并不普及,轮询还是一个比较常用的处理方法。比如查询一个项目的构建状态,预案执行的情况等等。所以直接在 useAsync 里内置了定时器,希望能最大程度上降低业务代码逻辑的复杂度。

我个人认为轮训的在所有 async 请求的比例不算太高,轮训应该是一个新的 hooks。
不过现在已经写了,也不能改了。

brickspert pushed a commit that referenced this issue Jun 16, 2020
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