-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adding CLAIM option to XREADGROUP command + unit tests #3825
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the claim_min_idle_time parameter to the xreadgroup command in Redis, enabling automatic claiming of pending messages based on their idle time. This feature allows consumers to reclaim messages from other consumers that have been pending for a specified duration.
- Added
claim_min_idle_timeparameter to thexreadgroupmethod inredis/commands/core.py - Modified response parsers to handle extended message format with idle time and delivery count when using
claim_min_idle_time - Added comprehensive test coverage for single and multiple stream scenarios in both sync and async test files
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 26 comments.
| File | Description |
|---|---|
| redis/commands/core.py | Added claim_min_idle_time parameter with validation and command building logic |
| redis/_parsers/helpers.py | Updated parsers to handle extended response format including idle time and delivery count |
| tests/test_commands.py | Added three test methods and helper validation function for the new feature in sync mode |
| tests/test_asyncio/test_commands.py | Added three test methods and helper validation function for the new feature in async mode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix spelling error. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix spelling error. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix spelling error. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This assignment to 'res' is unnecessary as it is redefined before this value is used. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
61ab6c9 to
b1ceca5
Compare
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Please provide a description of the change here.