Browse Source

Pull request #434: KERNEL-3881 状态服务器+集群锁相关代码解耦,脱离依赖redis

Merge in CORE/base-third from ~FENG/base-third:feature/10.0 to feature/10.0

* commit '1e356bf449dfe9ec00441ffac467a8bc165796d0':
  KERNEL-3881 状态服务器+集群锁相关代码解耦,脱离依赖redis
research/11.0
Feng 5 years ago
parent
commit
6858c665d9
  1. 10
      fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/JedisCluster.java
  2. 8
      fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/JedisPubSub.java

10
fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/JedisCluster.java

@ -1976,4 +1976,14 @@ public class JedisCluster extends BinaryJedisCluster implements JedisClusterComm
}
}.run(key);
}
//暴露出Client, 方便上层解耦
public Client getClient() {
Jedis jedis = this.connectionHandler.getConnection();
if (jedis != null) {
return jedis.getClient();
}
return null;
}
}

8
fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/JedisPubSub.java

@ -21,6 +21,14 @@ public abstract class JedisPubSub {
private int subscribedChannels = 0;
private volatile Client client;
public JedisPubSub() {
}
public JedisPubSub(Client client) {
this.client = client;
}
public void onMessage(String channel, String message) {
}

Loading…
Cancel
Save