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

请问一下用buffered channel来替换shaper是否可以? #57

Open
zii opened this issue Nov 19, 2019 · 2 comments
Open

请问一下用buffered channel来替换shaper是否可以? #57

zii opened this issue Nov 19, 2019 · 2 comments

Comments

@zii
Copy link

zii commented Nov 19, 2019

我其实没太看懂, 您的shaper版本是用来缓冲写操作的吧, 那么用队列的话是不是也可以? 性能上有没有什么差别?

@xtaci
Copy link
Owner

xtaci commented Jan 3, 2020

buffered chan无法模拟阻塞啊

@caleb-letsgo
Copy link

因为很多的 stream 都要往 underlying connection 上写数据,就要用 shaper 模块管理这些写请求,然后统一经由 underlying connection 发送。shaper 模块采用了优先级队列(利用 golang 的 heap 功能),优先级是:非 PSH 请求的优先级最高(非 PSH 请求的优先级别一样),PSH 请求越早的优先级越高。 

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

3 participants