All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ibole.infrastructure.cache.redis.pubsub.PPSubClient Maven / Gradle / Ivy

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