Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.hset()


                    }
                    for (String consumer : new HashSet<String>(getSubscribed().keySet())) {
                        URL url = URL.valueOf(consumer);
                        if (! Constants.ANY_VALUE.equals(url.getServiceInterface())) {
                            String key = toConsumerPath(url);
                            if (jedis.hset(key, consumer, String.valueOf(System.currentTimeMillis() + expirePeriod)) == 0) {
                                jedis.publish(key, Constants.SUBSCRIBE);
                            }
                        }
                    }
                    if (admin) {
View Full Code Here


        for (Map.Entry<String, JedisPool> entry : jedisPools.entrySet()) {
            JedisPool jedisPool = entry.getValue();
            try {
                Jedis jedis = jedisPool.getResource();
                try {
                    jedis.hset(key, value, expire);
                    jedis.publish(key, Constants.REGISTER);
                    success = true;
                } finally {
                    jedisPool.returnResource(jedis);
                }
View Full Code Here

                        }
                    } else {
                        String key = toConsumerPath(url);
                        String value = url.toFullString();
                        String expire = String.valueOf(System.currentTimeMillis() + expirePeriod);
                        jedis.hset(key, value, expire);
                        jedis.publish(key, Constants.SUBSCRIBE);
                        doNotify(jedis, service, url, listener);
                    }
                    success = true;
                    break; // 只需读一个服务器的数据
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.