Skip to content

Ability to configure reader buffer threshold#803

Merged
vgvoleg merged 1 commit intomainfrom
add_reader_buffer_threshold
Apr 8, 2026
Merged

Ability to configure reader buffer threshold#803
vgvoleg merged 1 commit intomainfrom
add_reader_buffer_threshold

Conversation

@vgvoleg
Copy link
Copy Markdown
Collaborator

@vgvoleg vgvoleg commented Apr 7, 2026

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Closes: #442

What is the new behavior?

Other information

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable buffer release threshold to the Topic reader so the client can batch “freed buffer” notifications (ReadRequests) to reduce round-trips.

Changes:

  • Exposes buffer_release_threshold on TopicClient.reader(...) (async + sync) and documents it.
  • Adds PublicReaderSettings.buffer_release_threshold with [0.0, 1.0] validation.
  • Implements accumulated buffer release + adds unit/integration tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ydb/topic.py Exposes buffer_release_threshold in public reader factory methods.
ydb/_topic_reader/topic_reader.py Adds setting + validates threshold range in PublicReaderSettings.
ydb/_topic_reader/topic_reader_asyncio.py Accumulates released bytes and sends ReadRequest when threshold is reached or queue empties.
ydb/_topic_reader/topic_reader_asyncio_test.py Adds unit tests for threshold behavior + validation.
tests/topics/test_topic_reader.py Adds async + sync integration tests to ensure the new parameter works end-to-end.
docs/topic.rst Documents the new parameter semantics and provides an example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ydb/_topic_reader/topic_reader_asyncio.py
Comment thread ydb/_topic_reader/topic_reader_asyncio_test.py Outdated
Comment thread docs/topic.rst Outdated
@vgvoleg vgvoleg force-pushed the add_reader_buffer_threshold branch from abca2d1 to 5f1b52b Compare April 7, 2026 19:44
@vgvoleg vgvoleg requested a review from Copilot April 7, 2026 19:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vgvoleg vgvoleg requested a review from rekby April 7, 2026 20:10
Comment thread docs/topic.rst Outdated
Comment thread ydb/_topic_reader/topic_reader_asyncio.py Outdated
Comment thread ydb/_topic_reader/topic_reader_asyncio.py Outdated
@vgvoleg vgvoleg force-pushed the add_reader_buffer_threshold branch from 5f1b52b to 67ee392 Compare April 8, 2026 09:38
@vgvoleg vgvoleg requested a review from Copilot April 8, 2026 09:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ydb/_topic_reader/topic_reader_asyncio.py
Comment thread ydb/_topic_reader/topic_reader.py
Comment thread docs/topic.rst Outdated
Comment thread ydb/_topic_reader/topic_reader_asyncio_test.py Outdated
@vgvoleg vgvoleg force-pushed the add_reader_buffer_threshold branch from 67ee392 to 662885a Compare April 8, 2026 10:09
@vgvoleg vgvoleg merged commit dde643e into main Apr 8, 2026
33 of 34 checks passed
@vgvoleg vgvoleg deleted the add_reader_buffer_threshold branch April 8, 2026 10:23
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.

feature: Batch new data requests

3 participants