Package redis.clients.jedis

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


   
    startLatch.await()
    long startTime = System.currentTimeMillis();
   
    for (int i=0; i<MESSAGES_TO_PUBLISH; i++) {
      jedis.publish(CHANNEL, "message"+i);     
    }
   
    print("Waiting for subscribers to receive all messages.");
    completionCounter.await();
   
View Full Code Here


    completionCounter.await();
   
    long diff = System.currentTimeMillis() - startTime;

    // Poison pill to subscribers.
    jedis.publish(CHANNEL, "unsubscribe");     

    print("Published "+MESSAGES_TO_PUBLISH+" messages and confirmed receival in "+SUBSCRIBER_AMOUNT+" subscribers in " + diff + " ms.");
   
    double publishedMessagesPerSecond = MESSAGES_TO_PUBLISH / (diff/1000d);
    print("Throughput (to confirmed delivery) with "+SUBSCRIBER_AMOUNT+" subscribers was about " + formatDouble(publishedMessagesPerSecond) + " published messages per second.");
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.