Skip to content

Support a more safe read function and variadic functions of DoublyBufferedData#2898

Merged
chenBright merged 4 commits into
apache:masterfrom
chenBright:dbd_read
Mar 21, 2025
Merged

Support a more safe read function and variadic functions of DoublyBufferedData#2898
chenBright merged 4 commits into
apache:masterfrom
chenBright:dbd_read

Conversation

@chenBright

@chenBright chenBright commented Feb 23, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary:

DoublyBufferedData::Read要配合ScopedPtr使用,使用上需要理解成本,甚至有可能会用错,导致死锁等问题。

What is changed and the side effects?

Changed:

  1. 增加一个DoublyBufferedData::Read重载函数,用户只需要传入自定义函数,操作T就可以了。
  2. 支持可变参数。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@wwbmmm

wwbmmm commented Feb 23, 2025

Copy link
Copy Markdown
Contributor

LGTM

@chenBright chenBright changed the title Add a convenient and safe DoublyBufferedData::Read Support a more safe read function and variadic functions of DoublyBufferedData Feb 24, 2025
@chenBright

chenBright commented Feb 24, 2025

Copy link
Copy Markdown
Contributor Author
  1. 入参Fn使用Universal Reference,扩展Fn的形式,可接收右值实参。
  2. 支持可变参数。
  3. 补充UT。

@yanglimingcn

Copy link
Copy Markdown
Contributor

LGTM

1 similar comment
@wwbmmm

wwbmmm commented Feb 25, 2025

Copy link
Copy Markdown
Contributor

LGTM

@chenBright chenBright merged commit da4e33a into apache:master Mar 21, 2025
@chenBright chenBright deleted the dbd_read branch March 21, 2025 15:42
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

Successfully merging this pull request may close these issues.

3 participants