Adding CLAIM option to XREADGROUP command + unit tests by petyaslavova · Pull Request #3825 · redis/redis-py (original) (raw)
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.