redis.clients.jedis.Queable Maven / Gradle / Ivy
package redis.clients.jedis;
import java.util.LinkedList;
import java.util.Queue;
public class Queable {
private Queue> pipelinedResponses = new LinkedList>();
protected void clean() {
pipelinedResponses.clear();
}
protected Response> generateResponse(Object data) {
Response> response = pipelinedResponses.poll();
if (response != null) {
response.set(data);
}
return response;
}
protected Response getResponse(Builder builder) {
Response lr = new Response(builder);
pipelinedResponses.add(lr);
return lr;
}
protected boolean hasPipelinedResponse() {
return !pipelinedResponses.isEmpty();
}
protected int getPipelinedResponseLength() {
return pipelinedResponses.size();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy