Class ReactivePubSubCommandsImpl<V>

java.lang.Object
io.quarkus.redis.runtime.datasource.AbstractRedisCommands
io.quarkus.redis.runtime.datasource.ReactivePubSubCommandsImpl<V>
All Implemented Interfaces:
ReactivePubSubCommands<V>, ReactiveRedisCommands

public class ReactivePubSubCommandsImpl<V> extends AbstractRedisCommands implements ReactivePubSubCommands<V>
  • Constructor Details

  • Method Details

    • getDataSource

      public ReactiveRedisDataSource getDataSource()
      Specified by:
      getDataSource in interface ReactiveRedisCommands
      Returns:
      the data source.
    • publish

      public io.smallrye.mutiny.Uni<Void> publish(String channel, V message)
      Description copied from interface: ReactivePubSubCommands
      Publishes a message to a given channel
      Specified by:
      publish in interface ReactivePubSubCommands<V>
      Parameters:
      channel - the channel
      message - the message
      Returns:
      a Uni producing a null item once the message is sent, a failure otherwise.
    • subscribe

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribe(String channel, Consumer<V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to a given channel.
      Specified by:
      subscribe in interface ReactivePubSubCommands<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 io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPattern(String pattern, Consumer<V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to a given pattern like chan*l.
      Specified by:
      subscribeToPattern in interface ReactivePubSubCommands<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
    • subscribeToPattern

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPattern(String pattern, BiConsumer<String,V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Same as ReactivePubSubCommands.subscribeToPattern(String, Consumer), but instead of receiving only the message payload, it also receives the name of the channel.
      Specified by:
      subscribeToPattern in interface ReactivePubSubCommands<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 io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPatterns(List<String> patterns, Consumer<V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to the given patterns like chan*l.
      Specified by:
      subscribeToPatterns in interface ReactivePubSubCommands<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
    • subscribeToPatterns

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPatterns(List<String> patterns, BiConsumer<String,V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Same as ReactivePubSubCommands.subscribeToPatterns(List, Consumer), but instead of only receiving the payload, it also receives the channel name.
      Specified by:
      subscribeToPatterns in interface ReactivePubSubCommands<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
    • subscribe

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribe(List<String> channels, Consumer<V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to the given channels.
      Specified by:
      subscribe in interface ReactivePubSubCommands<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 io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribe(List<String> channels, BiConsumer<String,V> onMessage)
      Description copied from interface: ReactivePubSubCommands
      Same as ReactivePubSubCommands.subscribe(List, Consumer), but instead of just receiving the payload, it also receives the channel name.
      Specified by:
      subscribe in interface ReactivePubSubCommands<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 channel name. The second one if the payload.
      Returns:
      the subscriber object that lets you unsubscribe
    • subscribe

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribe(String channel, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to a given channel.
      Specified by:
      subscribe in interface ReactivePubSubCommands<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 io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPattern(String pattern, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to a given pattern like chan*l.
      Specified by:
      subscribeToPattern in interface ReactivePubSubCommands<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
    • subscribeToPattern

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPattern(String pattern, BiConsumer<String,V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Specified by:
      subscribeToPattern in interface ReactivePubSubCommands<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 io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPatterns(List<String> patterns, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to the given patterns like chan*l.
      Specified by:
      subscribeToPatterns in interface ReactivePubSubCommands<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
    • subscribeToPatterns

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribeToPatterns(List<String> patterns, BiConsumer<String,V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Specified by:
      subscribeToPatterns in interface ReactivePubSubCommands<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 io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribe(List<String> channels, Consumer<V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to the given channels.
      Specified by:
      subscribe in interface ReactivePubSubCommands<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
    • subscribe

      public io.smallrye.mutiny.Uni<ReactivePubSubCommands.ReactiveRedisSubscriber> subscribe(List<String> channels, BiConsumer<String,V> onMessage, Runnable onEnd, Consumer<Throwable> onException)
      Description copied from interface: ReactivePubSubCommands
      Specified by:
      subscribe in interface ReactivePubSubCommands<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
    • subscribeToPatterns

      public io.smallrye.mutiny.Multi<V> subscribeToPatterns(String... patterns)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to the given patterns. This method returns a Multi emitting an item of type V for each received message. This emission happens on the I/O thread, so you must not block. Use emitOn to offload the processing to another thread.
      Specified by:
      subscribeToPatterns in interface ReactivePubSubCommands<V>
      Parameters:
      patterns - the patterns
      Returns:
      the stream of message
    • subscribeAsMessagesToPatterns

      public io.smallrye.mutiny.Multi<RedisPubSubMessage<V>> subscribeAsMessagesToPatterns(String... patterns)
      Description copied from interface: ReactivePubSubCommands
      Same as ReactivePubSubCommands.subscribeToPatterns(String...), but instead of receiving only the message payload, it receives instances of RedisPubSubMessage containing both the payload and the name of the channel.
      Specified by:
      subscribeAsMessagesToPatterns in interface ReactivePubSubCommands<V>
      Parameters:
      patterns - the patterns
      Returns:
      the stream of message
    • subscribe

      public io.smallrye.mutiny.Multi<V> subscribe(String... channels)
      Description copied from interface: ReactivePubSubCommands
      Subscribes to the given channels. This method returns a Multi emitting an item of type V for each received message. This emission happens on the I/O thread, so you must not block. Use emitOn to offload the processing to another thread.
      Specified by:
      subscribe in interface ReactivePubSubCommands<V>
      Parameters:
      channels - the channels
      Returns:
      the stream of message
    • subscribeAsMessages

      public io.smallrye.mutiny.Multi<RedisPubSubMessage<V>> subscribeAsMessages(String... channels)
      Description copied from interface: ReactivePubSubCommands
      Same as ReactivePubSubCommands.subscribe(String...), but instead of receiving the message payload directly, it receives instances of RedisPubSubMessage wrapping the payload and the channel on which the message has been sent.
      Specified by:
      subscribeAsMessages in interface ReactivePubSubCommands<V>
      Parameters:
      channels - the channels
      Returns:
      the stream of message