Class BlockingPubSubCommandsImpl<V>

java.lang.Object
io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
io.quarkus.redis.runtime.datasource.BlockingPubSubCommandsImpl<V>
All Implemented Interfaces:
PubSubCommands<V>, RedisCommands

public class BlockingPubSubCommandsImpl<V> extends AbstractRedisCommandGroup implements PubSubCommands<V>
  • Constructor Details

  • Method Details

    • publish

      public void publish(String channel, V message)
      Description copied from interface: PubSubCommands
      Publishes a message to a given channel
      Specified by:
      publish in interface PubSubCommands<V>
      Parameters:
      channel - the channel
      message - the message
    • subscribe

      public PubSubCommands.RedisSubscriber subscribe(String channel, Consumer<V> onMessage)
      Description copied from interface: PubSubCommands
      Subscribes to a given channel.
      Specified by:
      subscribe in interface PubSubCommands<V>
      Parameters:
      channel - the channel
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the given channel, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPattern

      public PubSubCommands.RedisSubscriber subscribeToPattern(String pattern, Consumer<V> onMessage)
      Description copied from interface: PubSubCommands
      Subscribes to a given pattern like chan*l.
      Specified by:
      subscribeToPattern in interface PubSubCommands<V>
      Parameters:
      pattern - the pattern
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPatterns

      public PubSubCommands.RedisSubscriber subscribeToPatterns(List<String> patterns, Consumer<V> onMessage)
      Description copied from interface: PubSubCommands
      Subscribes to the given patterns like chan*l.
      Specified by:
      subscribeToPatterns in interface PubSubCommands<V>
      Parameters:
      patterns - the patterns
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribe

      public PubSubCommands.RedisSubscriber subscribe(List<String> channels, Consumer<V> onMessage)
      Description copied from interface: PubSubCommands
      Subscribes to the given channels.
      Specified by:
      subscribe in interface PubSubCommands<V>
      Parameters:
      channels - the channels
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the given channels, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribe

      public PubSubCommands.RedisSubscriber subscribe(String channel, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Subscribes to a given channel.
      Specified by:
      subscribe in interface PubSubCommands<V>
      Parameters:
      channel - the channel
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the given channel, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPattern

      public PubSubCommands.RedisSubscriber subscribeToPattern(String pattern, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Subscribes to a given pattern like chan*l.
      Specified by:
      subscribeToPattern in interface PubSubCommands<V>
      Parameters:
      pattern - the pattern
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPatterns

      public PubSubCommands.RedisSubscriber subscribeToPatterns(List<String> patterns, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Subscribes to the given patterns like chan*l.
      Specified by:
      subscribeToPatterns in interface PubSubCommands<V>
      Parameters:
      patterns - the patterns
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribe

      public PubSubCommands.RedisSubscriber subscribe(List<String> channels, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Subscribes to the given channels.
      Specified by:
      subscribe in interface PubSubCommands<V>
      Parameters:
      channels - the channels
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the given channels, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPattern

      public PubSubCommands.RedisSubscriber subscribeToPattern(String pattern, BiConsumer<String,V> onMessage)
      Description copied from interface: PubSubCommands
      Same as PubSubCommands.subscribeToPattern(String, Consumer), but instead of receiving only the message payload, it also receives the name of the channel.
      Specified by:
      subscribeToPattern in interface PubSubCommands<V>
      Parameters:
      pattern - the pattern
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed. The first parameter is the name of the channel. The second parameter is the payload.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPatterns

      public PubSubCommands.RedisSubscriber subscribeToPatterns(List<String> patterns, BiConsumer<String,V> onMessage)
      Description copied from interface: PubSubCommands
      Same as PubSubCommands.subscribeToPatterns(List, Consumer), but instead of only receiving the payload, it also receives the channel name.
      Specified by:
      subscribeToPatterns in interface PubSubCommands<V>
      Parameters:
      patterns - the patterns
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed. The first parameter is the channel name. The second one if the payload.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPattern

      public PubSubCommands.RedisSubscriber subscribeToPattern(String pattern, BiConsumer<String,V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Specified by:
      subscribeToPattern in interface PubSubCommands<V>
      Parameters:
      pattern - the pattern
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed. The first parameter is the name of the channel. The second parameter is the payload.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribeToPatterns

      public PubSubCommands.RedisSubscriber subscribeToPatterns(List<String> patterns, BiConsumer<String,V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Specified by:
      subscribeToPatterns in interface PubSubCommands<V>
      Parameters:
      patterns - the patterns
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the channels matching the pattern, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed. The first parameter is the name of the channel. The second parameter is the payload.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribe

      public PubSubCommands.RedisSubscriber subscribe(List<String> channels, BiConsumer<String,V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: PubSubCommands
      Same as PubSubCommands.subscribe(List, Consumer, Runnable, Consumer) but also receives the channel name.
      Specified by:
      subscribe in interface PubSubCommands<V>
      Parameters:
      channels - the channels
      onMessage - the message consumer. Be aware that this callback is invoked for each message sent to the given channels, and is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed. The first parameter is the name of the channel. The second parameter is the payload.
      onEnd - the end handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      onException - the exception handler. Be aware that this callback is invoked on the I/O thread. So, you must not block. Offload to a separate thread if needed.
      Returns:
      the subscriber object that lets you unsubscribe