Implement Closeable for Jedis, BinaryJedis etc.
This allows a Jedis object to participate in try-with-resources when using Java 7+. This change is fully backwards compatible to Java 6 and previous releases of the Jedis client.
This commit is contained in:
@@ -948,6 +948,12 @@ public class BinaryClient extends Connection {
|
||||
super.disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
db = 0;
|
||||
super.close();
|
||||
}
|
||||
|
||||
public void resetState() {
|
||||
if (isInMulti())
|
||||
discard();
|
||||
|
||||
Reference in New Issue
Block a user