diff options
author | Avital Fine <79420960+AvitalFineRedis@users.noreply.github.com> | 2021-10-19 12:04:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 13:04:46 +0300 |
commit | 39814846b765b1bba33cd7520b6462a9816c9d4a (patch) | |
tree | c7a870dff97bca6854c32072ee203e049cd6fd93 /redis | |
parent | 039488d97ec545b37e903d1b791a88bac8f77973 (diff) | |
download | redis-py-39814846b765b1bba33cd7520b6462a9816c9d4a.tar.gz |
Add support to consumername in `xpending_range` (#1602)
Diffstat (limited to 'redis')
-rw-r--r-- | redis/commands.py | 14 |
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) |