Fixes xetorthio/jedis#758
This commit is contained in:
@@ -88,17 +88,18 @@ public class Pipeline extends MultiKeyPipelineBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syncronize pipeline by reading all responses. This operation close the
|
* Synchronize pipeline by reading all responses. This operation close the
|
||||||
* pipeline. In order to get return values from pipelined commands, capture
|
* pipeline. In order to get return values from pipelined commands, capture
|
||||||
* the different Response<?> of the commands you execute.
|
* the different Response<?> of the commands you execute.
|
||||||
*/
|
*/
|
||||||
public void sync() {
|
public void sync() {
|
||||||
|
if (client.isConnected()) {
|
||||||
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
||||||
for (Object o : unformatted) {
|
for (Object o : unformatted) {
|
||||||
generateResponse(o);
|
generateResponse(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Syncronize pipeline by reading all responses. This operation close the
|
* Syncronize pipeline by reading all responses. This operation close the
|
||||||
* pipeline. Whenever possible try to avoid using this version and use
|
* pipeline. Whenever possible try to avoid using this version and use
|
||||||
@@ -108,6 +109,7 @@ public class Pipeline extends MultiKeyPipelineBase {
|
|||||||
* @return A list of all the responses in the order you executed them.
|
* @return A list of all the responses in the order you executed them.
|
||||||
*/
|
*/
|
||||||
public List<Object> syncAndReturnAll() {
|
public List<Object> syncAndReturnAll() {
|
||||||
|
if (client.isConnected()) {
|
||||||
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
||||||
List<Object> formatted = new ArrayList<Object>();
|
List<Object> formatted = new ArrayList<Object>();
|
||||||
|
|
||||||
@@ -119,6 +121,9 @@ public class Pipeline extends MultiKeyPipelineBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return formatted;
|
return formatted;
|
||||||
|
} else {
|
||||||
|
return java.util.Collections.<Object>emptyList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> discard() {
|
public Response<String> discard() {
|
||||||
|
|||||||
Reference in New Issue
Block a user