RT,为啥要用多线程
8 回复
public void run() {
int count = 1;
while (running && (jedisAgent == null || !jedisAgent.isReady())) {
Lang.quiteSleep(100);
}
log.info("JedisAgent is Ready ...");
while (running) {
try {
log.debug("psubscribe " + PREFIX + "*");
jedis().psubscribe(pubSub, PREFIX + "*");
}
catch (Exception e) {
if (!running)
break;
log.debug("psubscribe fail, retry after 3 seconds", e);
Lang.quiteSleep(count * 1000);
}
}
}
run里面写了这么多东西 。。你告诉我写多了。。不写这个怎么发布订阅。。。
添加回复
请先登陆