Package redis.clients.jedis

Examples of redis.clients.jedis.BinaryJedisPubSub


    }

    @Test
    public void binarySubscribe() throws UnknownHostException, IOException,
      InterruptedException {
  jedis.subscribe(new BinaryJedisPubSub() {
      public void onMessage(byte[] channel, byte[] message) {
    assertTrue(Arrays.equals(SafeEncoder.encode("foo"), channel));
    assertTrue(Arrays.equals(SafeEncoder.encode("exit"), message));
    unsubscribe();
      }
View Full Code Here


    }

    @Test
    public void binarySubscribeMany() throws UnknownHostException, IOException,
      InterruptedException {
  jedis.subscribe(new BinaryJedisPubSub() {
      public void onMessage(byte[] channel, byte[] message) {
    unsubscribe(channel);
      }

      public void onSubscribe(byte[] channel, int subscribedChannels) {
View Full Code Here

    }

    @Test
    public void binaryPsubscribe() throws UnknownHostException, IOException,
      InterruptedException {
  jedis.psubscribe(new BinaryJedisPubSub() {
      public void onMessage(byte[] channel, byte[] message) {
      }

      public void onSubscribe(byte[] channel, int subscribedChannels) {
      }
View Full Code Here

    }

    @Test
    public void binaryPsubscribeMany() throws UnknownHostException,
      IOException, InterruptedException {
  jedis.psubscribe(new BinaryJedisPubSub() {
      public void onMessage(byte[] channel, byte[] message) {
      }

      public void onSubscribe(byte[] channel, int subscribedChannels) {
      }
View Full Code Here

    }

    @Test
    public void binarySubscribeLazily() throws UnknownHostException,
      IOException, InterruptedException {
  final BinaryJedisPubSub pubsub = new BinaryJedisPubSub() {
      public void onMessage(byte[] channel, byte[] message) {
    unsubscribe(channel);
      }

      public void onSubscribe(byte[] channel, int subscribedChannels) {
View Full Code Here

      }
      if (isPipelined()) {
        throw new UnsupportedOperationException();
      }

      BinaryJedisPubSub jedisPubSub = JedisUtils.adaptPubSub(listener);

      subscription = new JedisSubscription(listener, jedisPubSub, null, patterns);
      jedis.psubscribe(jedisPubSub, patterns);

    } catch (Exception ex) {
View Full Code Here

      }
      if (isPipelined()) {
        throw new UnsupportedOperationException();
      }

      BinaryJedisPubSub jedisPubSub = JedisUtils.adaptPubSub(listener);

      subscription = new JedisSubscription(listener, jedisPubSub, channels, null);
      jedis.subscribe(jedisPubSub, channels);

    } catch (Exception ex) {
View Full Code Here

    if (isPipelined()) {
      throw new UnsupportedOperationException();
    }

    try {
      BinaryJedisPubSub jedisPubSub = new JedisMessageListener(listener);

      subscription = new JedisSubscription(listener, jedisPubSub, null, patterns);
      jedis.psubscribe(jedisPubSub, patterns);

    } catch (Exception ex) {
View Full Code Here

    if (isPipelined()) {
      throw new UnsupportedOperationException();
    }

    try {
      BinaryJedisPubSub jedisPubSub = new JedisMessageListener(listener);

      subscription = new JedisSubscription(listener, jedisPubSub, channels, null);
      jedis.subscribe(jedisPubSub, channels);

    } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of redis.clients.jedis.BinaryJedisPubSub

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.