diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-10-31 23:03:12 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2018-10-31 23:03:12 -0700 |
commit | c22956dcb23845830b471b5c8bbdf675f3b9debb (patch) | |
tree | 49982434ef24a86d1f43f2246f517fc7d2ccdd0e | |
parent | 84efaa73e71d83c8e2ff86c9e0d7fade851cf1e8 (diff) | |
download | redis-py-c22956dcb23845830b471b5c8bbdf675f3b9debb.tar.gz |
guarentee consistency by mapping the keys/values with one call
-rwxr-xr-x | redis/client.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 45f1ff0..15be7b8 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1993,8 +1993,9 @@ class StrictRedis(object): if not isinstance(streams, dict) or len(streams) == 0: raise RedisError('XREAD streams must be a non empty dict') pieces.append(Token.get_token('STREAMS')) - pieces.extend(streams.keys()) - pieces.extend(streams.values()) + keys, values = izip(*iteritems(streams)) + pieces.extend(keys) + pieces.extend(values) return self.execute_command('XREAD', *pieces) def xreadgroup(self, groupname, consumername, streams, count=None, |