redis.clients.jedis.Transaction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jredisearch-jedis Show documentation
Show all versions of jredisearch-jedis Show documentation
Jedis is a blazingly small and sane Redis java client. This is a fork of master
The newest version!
package redis.clients.jedis;
import java.io.Closeable;
import java.util.ArrayList;
import java.util.List;
import redis.clients.jedis.exceptions.JedisDataException;
/**
* Transaction is nearly identical to Pipeline, only differences are the multi/discard behaviors
*/
public class Transaction extends MultiKeyPipelineBase implements Closeable {
protected boolean inTransaction = true;
protected Transaction() {
// client will be set later in transaction block
}
public Transaction(final Client client) {
this.client = client;
}
@Override
protected Client getClient(String key) {
return client;
}
@Override
protected Client getClient(byte[] key) {
return client;
}
public void clear() {
if (inTransaction) {
discard();
}
}
public List