netpoll icon indicating copy to clipboard operation
netpoll copied to clipboard

feat: add WithReadThreshold API

Open joway opened this issue 2 years ago • 1 comments

What type of PR is this?

feat

Check the PR title.

  • [x] This PR title match the format: <type>(optional scope): <description>
  • [x] The description of this PR title is user-oriented and clear enough for others to understand.
  • [x] Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

feat: 添加 WithReadThreshold API

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: zh(optional):

关键代码:

  1. poller 通过 intputAck 检查是否当前已经读取的数据超出了阈值。若是,则移除 epollin (此时还需要判断是否正在等待可写入事件)
  2. 用户代码每次 waitRead 结束,都会判断本次读取是否能够将 intputBuffer 长度缩小到 readThreshold 以内。如果可以的话就恢复读取
  3. dialer 支持 netpoll.Option 参数

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

joway avatar Dec 07 '23 09:12 joway

请问下这个PR的进度如何?

hujm2023 avatar Jun 01 '25 05:06 hujm2023