We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Pool.Submit和PoolWithFunc.Server提交任务,如果没有空的worker,会一直阻塞。建议增加不阻塞的接口,当前失败时直接返回错误。
Pool.Submit
PoolWithFunc.Server
The text was updated successfully, but these errors were encountered:
这个需求很痛,现在如果想做熔断、限流一类的逻辑要在 pool 外面再包一层,其实完全可以在 pool 里做。
@panjf2000 我理解加个配置项,直接在 retrieveWorker 里面 reentry 那个分支判断一下然后返回 nil,Submit 里加一下对 retrieveWorker 返回值的判断就可以了?如果没什么问题我来搞一下
Sorry, something went wrong.
大体思路应该是这样没错,我以前觉得熔断or限流这个逻辑应该在业务层实现,保持library的generality,不过好像有不少人都提出希望把这个feature加入到lib里,现在想想,熔断这个feature放到business或者放到library,貌似两个都能说得通。
So,你有时间的话提个PR吧,然后我再review一下,thanks~🤝
这里我觉得应该在 pool 里实现,主要是因为目前 pool 没有任何接口能让我了解现在的拥塞状况,调用了 Submit 之后就直接卡在里面了;Running 和 Cap 之类的也不大准确,对于瞬间的突发流量没法用 Running 来衡量压力。
No branches or pull requests
Pool.Submit
和PoolWithFunc.Server
提交任务,如果没有空的worker,会一直阻塞。建议增加不阻塞的接口,当前失败时直接返回错误。The text was updated successfully, but these errors were encountered: