com.github.ibole.infrastructure.cache.redis.pubsub.PubClient 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;
/*********************************************************************************************.
*
*
* Copyright 2016, iBole Inc. All rights reserved.
*
*
.
*
*********************************************************************************************/
public class PubClient {
private Jedis jedis;//
public PubClient(String host,int port, String password){
jedis = JedisUtil.getInstance().getJedis(host, port, password);
}
public void pub(String channel,String message){
jedis.publish(channel, message);
jedis.rpush(channel, message);
}
public void close(String channel){
jedis.publish(channel, "quit");
jedis.del(channel);//
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy