diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-06-16 16:20:05 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-06-16 16:20:05 -0700 |
commit | dffc6f97ce5cce454c07006e03b70c4cf41348bd (patch) | |
tree | a99b875873b35ae0227b288eb15c2a3c61759b36 /redis/client.py | |
parent | 1acc67ac789b9a4cc8f480fbf328ae4c711e29a0 (diff) | |
download | redis-py-dffc6f97ce5cce454c07006e03b70c4cf41348bd.tar.gz |
pack multiple commands in a pipeline into larger strings.
fixes #495
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/redis/client.py b/redis/client.py index 03a86ab..0ab8081 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1,5 +1,5 @@ from __future__ import with_statement -from itertools import chain, starmap +from itertools import chain import datetime import sys import warnings @@ -2413,9 +2413,7 @@ class BasePipeline(object): def _execute_transaction(self, connection, commands, raise_on_error): cmds = chain([(('MULTI', ), {})], commands, [(('EXEC', ), {})]) - all_cmds = chain.from_iterable( - starmap(connection.pack_command, - [args for args, options in cmds])) + all_cmds = connection.pack_commands([args for args, _ in cmds]) connection.send_packed_command(all_cmds) errors = [] @@ -2476,9 +2474,7 @@ class BasePipeline(object): def _execute_pipeline(self, connection, commands, raise_on_error): # build up all commands into a single request to increase network perf - all_cmds = chain.from_iterable( - starmap(connection.pack_command, - [args for args, options in commands])) + all_cmds = connection.pack_commands([args for args, _ in commands]) connection.send_packed_command(all_cmds) response = [] |