summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorRoey Prat <roey.prat@redislabs.com>2018-10-28 11:52:01 +0200
committerRoey Prat <roey.prat@redislabs.com>2018-10-28 14:13:42 +0200
commit3ba1d14bc74f9a5045d714ce67422ef05b59b724 (patch)
treeeeb0e285f2c8e4fe2f79aa5d2a0948f5ece37113 /redis/client.py
parent4ad035dfc94582d8265572439a2f0bdf41637e79 (diff)
downloadredis-py-3ba1d14bc74f9a5045d714ce67422ef05b59b724.tar.gz
allow list based iterating on XREADGROUP results
Diffstat (limited to 'redis/client.py')
-rwxr-xr-xredis/client.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/redis/client.py b/redis/client.py
index c055496..13c01d0 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -266,13 +266,10 @@ def parse_xclaim(response):
return stream_list(response)
-def multi_stream_list(response):
+def parse_xreadgroup(response):
if response is None:
return None
- result = dict()
- for r in response:
- result[nativestr(r[0])] = stream_list(r[1])
- return result
+ return [[nativestr(r[0]), stream_list(r[1])] for r in response]
def float_or_none(response):
@@ -413,7 +410,7 @@ class StrictRedis(object):
int
),
string_keys_to_dict('XREVRANGE XRANGE', stream_list),
- string_keys_to_dict('XREAD XREADGROUP', multi_stream_list),
+ string_keys_to_dict('XREAD XREADGROUP', parse_xreadgroup),
{
'XGROUP CREATE': bool_ok,
'XGROUP DESTROY': int,