avoid creating pipeline responses and do it lazy

This commit is contained in:
Jonathan Leibiusky
2011-05-30 13:43:21 -03:00
parent 44c3eef60e
commit d690833ed6
5 changed files with 51 additions and 16 deletions

View File

@@ -2015,10 +2015,19 @@ public class BinaryJedis implements BinaryJedisCommands {
return client.getStatusCodeReply();
}
/**
* Starts a pipeline, which is a very efficient way to send lots of command
* and read all the responses when you finish sending them. Try to avoid
* this version and use pipelined() when possible as it will give better
* performance.
*
* @param jedisPipeline
* @return The results of the command in the same order you've run them.
*/
public List<Object> pipelined(final PipelineBlock jedisPipeline) {
jedisPipeline.setClient(client);
jedisPipeline.execute();
return jedisPipeline.sync();
return jedisPipeline.syncAndReturnAll();
}
public Pipeline pipelined() {