本文整理了Java中redis.clients.jedis.Jedis.psubscribe()
方法的一些代码示例,展示了Jedis.psubscribe()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.psubscribe()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:psubscribe
暂无
代码示例来源:origin: caoxinyu/RedisClient
@Override
protected void command() {
jedis.psubscribe(callback, channels);
}
代码示例来源:origin: apache/incubator-dubbo
jedis.psubscribe(new NotifySub(jedisPool), service); // blocking
} else {
if (!first) {
resetSkip();
jedis.psubscribe(new NotifySub(jedisPool), service + Constants.PATH_SEPARATOR + Constants.ANY_VALUE); // blocking
代码示例来源:origin: apache/incubator-dubbo
jedis.psubscribe(new NotifySub(jedisPool), service); // blocking
} else {
if (!first) {
resetSkip();
jedis.psubscribe(new NotifySub(jedisPool), service + Constants.PATH_SEPARATOR + Constants.ANY_VALUE); // blocking
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public void pSubscribe(MessageListener listener, byte[]... patterns) {
if (isSubscribed()) {
throw new RedisSubscribedConnectionException(
"Connection already subscribed; use the connection Subscription to cancel or add new channels");
}
if (isQueueing()) {
throw new UnsupportedOperationException();
}
if (isPipelined()) {
throw new UnsupportedOperationException();
}
try {
BinaryJedisPubSub jedisPubSub = new JedisMessageListener(listener);
subscription = new JedisSubscription(listener, jedisPubSub, null, patterns);
jedis.psubscribe(jedisPubSub, patterns);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: stackoverflow.com
public class Subscriber {
public static void main(String[] args) {
JedisPool pool = new JedisPool(new JedisPoolConfig(), "localhost");
Jedis jedis = pool.getResource();
jedis.psubscribe(new KeyExpiredListener(), "__key*__:*");
}
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Object execute(Jedis jedis) {
jedis.psubscribe(jedisPubSub, patterns);
return null;
}
});
代码示例来源:origin: io.leopard/leopard-redis
@Override
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
super.psubscribe(jedisPubSub, patterns);
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Integer execute(Jedis connection) {
connection.psubscribe(jedisPubSub, patterns);
return 0;
}
}.runWithAnyNode();
代码示例来源:origin: apache/servicemix-bundles
@Override
public Integer execute(Jedis connection) {
connection.psubscribe(jedisPubSub, patterns);
return 0;
}
}.runWithAnyNode();
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
delegated.psubscribe(jedisPubSub, patterns);
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public void psubscribe(BinaryJedisPubSub jedisPubSub, byte[]... patterns) {
delegated.psubscribe(jedisPubSub, patterns);
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
super.psubscribe(jedisPubSub, patterns);
}
代码示例来源:origin: penggle/jedis-ms-sentinel
public void psubscribe(BinaryJedisPubSub jedisPubSub, byte[]... patterns) {
master.psubscribe(jedisPubSub, patterns);
}
代码示例来源:origin: io.enoa/nosql-redis
default void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
this.run((jedis, serializer) -> {
jedis.psubscribe(jedisPubSub, patterns);
return this;
});
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-redis
/**
* Runs a subscriber to the given patterns.
*
* @param subscriber the subscriber
* @param patterns the channel patterns
* @since 9.1
*/
default void psubscribe(JedisPubSub subscriber, String... patterns) throws JedisException {
execute(jedis -> {
jedis.psubscribe(subscriber, patterns);
return null;
});
}
代码示例来源:origin: hansiming/JobHunter
public void psubscribe(final JedisPubSub jedisPubSub, final String... patterns) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
jedis.psubscribe(jedisPubSub, patterns);
// LOOGER.debug("psubscribe {}", Objects.toString(patterns));
} catch (Exception e) {
LOOGER.warn("psubscribe = {}", Objects.toString(patterns));
} finally {
returnResource(jedis);
}
}
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
jedis().psubscribe(jedisPubSub, patterns);
}
代码示例来源:origin: mayconbordin/storm-applications
@Override
public void run() {
Jedis jedis = pool.getResource();
try {
jedis.psubscribe(new JedisListener(queue), pattern);
} finally {
pool.returnResource(jedis);
}
}
}
代码示例来源:origin: mindwind/craft-atom
@Override
public void run() {
Jedis j = null;
try {
j = jedis();
j.psubscribe(jps, patterns);
} catch (Exception e) {
RedisException re = handleException(e, j);
handler.onException(re);
} finally {
s.release(permits);
}
}
}, "redis-psubscribe-" + Thread.currentThread().getId());
代码示例来源:origin: AmadeusITGroup/HttpSessionReplacer
@Override
public void psubscribe(final RedisPubSub listener, String pattern) {
BinaryJedisPubSub bps = new BinaryJedisPubSub() {
@Override
public void onPMessage(byte[] pattern, byte[] channel, byte[] message) {
listener.onPMessage(pattern, channel, message);
}
};
listener.link(bps);
jedis().psubscribe(bps, encode(pattern));
}
内容来源于网络,如有侵权,请联系作者删除!