diff options
author | Roey Prat <roey.prat@redislabs.com> | 2018-10-28 11:52:01 +0200 |
---|---|---|
committer | Roey Prat <roey.prat@redislabs.com> | 2018-10-28 14:13:42 +0200 |
commit | 3ba1d14bc74f9a5045d714ce67422ef05b59b724 (patch) | |
tree | eeb0e285f2c8e4fe2f79aa5d2a0948f5ece37113 /redis/client.py | |
parent | 4ad035dfc94582d8265572439a2f0bdf41637e79 (diff) | |
download | redis-py-3ba1d14bc74f9a5045d714ce67422ef05b59b724.tar.gz |
allow list based iterating on XREADGROUP results
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 9 |
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, |