summaryrefslogtreecommitdiff
path: root/redis
diff options
context:
space:
mode:
authorAvital Fine <79420960+AvitalFineRedis@users.noreply.github.com>2021-10-19 12:04:46 +0200
committerGitHub <noreply@github.com>2021-10-19 13:04:46 +0300
commit39814846b765b1bba33cd7520b6462a9816c9d4a (patch)
treec7a870dff97bca6854c32072ee203e049cd6fd93 /redis
parent039488d97ec545b37e903d1b791a88bac8f77973 (diff)
downloadredis-py-39814846b765b1bba33cd7520b6462a9816c9d4a.tar.gz
Add support to consumername in `xpending_range` (#1602)
Diffstat (limited to 'redis')
-rw-r--r--redis/commands.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/redis/commands.py b/redis/commands.py
index 62c082d..44a7735 100644
--- a/redis/commands.py
+++ b/redis/commands.py
@@ -2065,18 +2065,21 @@ class Commands:
"""
return self.execute_command('XPENDING', name, groupname)
- def xpending_range(self, name, groupname, min, max, count,
- consumername=None, idle=None):
+ def xpending_range(self, name, groupname, idle=None,
+ min=None, max=None, count=None,
+ consumername=None):
"""
Returns information about pending messages, in a range.
+
name: name of the stream.
groupname: name of the consumer group.
+ idle: available from version 6.2. filter entries by their
+ idle-time, given in milliseconds (optional).
min: minimum stream ID.
max: maximum stream ID.
count: number of messages to return
consumername: name of a consumer to filter by (optional).
- idle: available from version 6.2. filter entries by their
- idle-time, given in milliseconds (optional).
+
"""
if {min, max, count} == {None}:
if idle is not None or consumername is not None:
@@ -2103,6 +2106,9 @@ class Commands:
pieces.extend([min, max, count])
except TypeError:
pass
+ # consumername
+ if consumername:
+ pieces.append(consumername)
return self.execute_command('XPENDING', *pieces, parse_detail=True)