com.github.ibole.infrastructure.cache.redis.pubsub.PPSubClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infrastructure-all Show documentation
Show all versions of infrastructure-all Show documentation
The all in one project of ibole infrastructure
The newest version!
package com.github.ibole.infrastructure.cache.redis.pubsub;
import com.github.ibole.infrastructure.cache.redis.JedisUtil;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;
/*********************************************************************************************.
*
*
* Copyright 2016, iBole Inc. All rights reserved.
*
*
.
*
*********************************************************************************************/
public class PPSubClient {
private Jedis jedis;//
private JedisPubSub listener;//单listener
public PPSubClient(String host,int port, String password,String clientId){
jedis = JedisUtil.getInstance().getJedis(host, port, password);;
listener = new PPrintListener(clientId, new Jedis(host, port));
}
public void sub(String channel){
jedis.subscribe(listener, channel);
}
public void unsubscribe(String channel){
listener.unsubscribe(channel);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy