Package redis.clients.jedis

Examples of redis.clients.jedis.JedisPubSub


     */
    @Override                                                                
    public void incomingBroadcast() {
        logger.info("Subscribing to: {}", getID());

        jedisSubscriber.subscribe(new JedisPubSub() {

            public void onMessage(String channel, String message) {
                broadcastReceivedMessage(message);
            }

View Full Code Here


        logger.info("Starting Atmosphere Redis Clustering support");

        final Broadcaster broadcaster = bc;
        listener.submit(new Runnable() {
            public void run() {
                jedisSubscriber.subscribe(new JedisPubSub() {
                    public void onMessage(String channel, String message) {
                        receivedMessages.offer(message);
                        broadcaster.broadcast(message);
                    }
View Full Code Here

     * {@inheritDoc}
     */
    public void incomingBroadcast() {
        logger.info("Subscribing to: {}", callback.getID());

        jedisSubscriber.subscribe(new JedisPubSub() {

            public void onMessage(String channel, String message) {
                callback.broadcastReceivedMessage(message);
            }

View Full Code Here

  t.start();
    }

    @Test
    public void subscribe() throws InterruptedException {
  jedis.subscribe(new JedisPubSub() {
      public void onMessage(String channel, String message) {
    assertEquals("foo", channel);
    assertEquals("exit", message);
    unsubscribe();
      }
View Full Code Here

    @Test
    public void pubSubChannels() {
  final List<String> expectedActiveChannels = Arrays.asList("testchan1",
    "testchan2", "testchan3");
  jedis.subscribe(new JedisPubSub() {
      private int count = 0;

      @Override
      public void onUnsubscribe(String channel, int subscribedChannels) {
      }
View Full Code Here

  }, "testchan1", "testchan2", "testchan3");
    }

    @Test
    public void pubSubNumPat() {
  jedis.psubscribe(new JedisPubSub() {
      private int count = 0;

      @Override
      public void onUnsubscribe(String channel, int subscribedChannels) {
      }
View Full Code Here

    @Test
    public void pubSubNumSub() {
  final Map<String, String> expectedNumSub = new HashMap<String, String>();
  expectedNumSub.put("testchannel2", "1");
  expectedNumSub.put("testchannel1", "1");
  jedis.subscribe(new JedisPubSub() {
      private int count = 0;

      @Override
      public void onUnsubscribe(String channel, int subscribedChannels) {
      }
View Full Code Here

    }

    @Test
    public void subscribeMany() throws UnknownHostException, IOException,
      InterruptedException {
  jedis.subscribe(new JedisPubSub() {
      public void onMessage(String channel, String message) {
    unsubscribe(channel);
      }

      public void onSubscribe(String channel, int subscribedChannels) {
View Full Code Here

    }

    @Test
    public void psubscribe() throws UnknownHostException, IOException,
      InterruptedException {
  jedis.psubscribe(new JedisPubSub() {
      public void onMessage(String channel, String message) {
      }

      public void onSubscribe(String channel, int subscribedChannels) {
      }
View Full Code Here

    }

    @Test
    public void psubscribeMany() throws UnknownHostException, IOException,
      InterruptedException {
  jedis.psubscribe(new JedisPubSub() {
      public void onMessage(String channel, String message) {
      }

      public void onSubscribe(String channel, int subscribedChannels) {
      }
View Full Code Here

TOP

Related Classes of redis.clients.jedis.JedisPubSub

Copyright © 2018 www.massapicom. 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.