Merge branch 'master' of https://github.com/nilskp/jedis into fixes-758
This commit is contained in:
@@ -88,19 +88,20 @@ 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() {
|
||||||
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
if (getPipelinedResponseLength() > 0) {
|
||||||
for (Object o : unformatted) {
|
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
||||||
generateResponse(o);
|
for (Object o : unformatted) {
|
||||||
}
|
generateResponse(o);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syncronize pipeline by reading all responses. This operation close the
|
* Synchronize 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
|
||||||
* Pipeline.sync() as it won't go through all the responses and generate the
|
* Pipeline.sync() as it won't go through all the responses and generate the
|
||||||
* right response type (usually it is a waste of time).
|
* right response type (usually it is a waste of time).
|
||||||
@@ -108,17 +109,20 @@ 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() {
|
||||||
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
if (getPipelinedResponseLength() > 0) {
|
||||||
List<Object> formatted = new ArrayList<Object>();
|
List<Object> unformatted = client.getMany(getPipelinedResponseLength());
|
||||||
|
List<Object> formatted = new ArrayList<Object>();
|
||||||
for (Object o : unformatted) {
|
for (Object o : unformatted) {
|
||||||
try {
|
try {
|
||||||
formatted.add(generateResponse(o).get());
|
formatted.add(generateResponse(o).get());
|
||||||
} catch (JedisDataException e) {
|
} catch (JedisDataException e) {
|
||||||
formatted.add(e);
|
formatted.add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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