redis.clients.jedis.Queable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis Show documentation
Show all versions of jedis Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
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();
}
}