Module lettuce.core

Interface RedisPubSubReactiveCommands<K,​V>

Type Parameters:
K - Key type.
V - Value type.
All Superinterfaces:
BaseRedisReactiveCommands<K,​V>, RedisAclReactiveCommands<K,​V>, RedisClusterReactiveCommands<K,​V>, RedisGeoReactiveCommands<K,​V>, RedisHashReactiveCommands<K,​V>, RedisHLLReactiveCommands<K,​V>, RedisKeyReactiveCommands<K,​V>, RedisListReactiveCommands<K,​V>, RedisReactiveCommands<K,​V>, RedisScriptingReactiveCommands<K,​V>, RedisServerReactiveCommands<K,​V>, RedisSetReactiveCommands<K,​V>, RedisSortedSetReactiveCommands<K,​V>, RedisStreamReactiveCommands<K,​V>, RedisStringReactiveCommands<K,​V>, RedisTransactionalReactiveCommands<K,​V>
All Known Subinterfaces:
RedisClusterPubSubReactiveCommands<K,​V>
All Known Implementing Classes:
RedisClusterPubSubReactiveCommandsImpl, RedisPubSubReactiveCommandsImpl

public interface RedisPubSubReactiveCommands<K,​V>
extends RedisReactiveCommands<K,​V>
Asynchronous and thread-safe Redis PubSub API.
Since:
5.0
Author:
Mark Paluch
  • Method Details

    • observePatterns

      Flux<PatternMessage<K,​V>> observePatterns()
      Flux for messages (pmessage) received though pattern subscriptions. The connection needs to be subscribed to one or more patterns using psubscribe(Object[]).

      Warning! This method uses FluxSink.OverflowStrategy.BUFFER This does unbounded buffering and may lead to OutOfMemoryError. Use observePatterns(FluxSink.OverflowStrategy) to specify a different strategy.

      Returns:
      hot Flux for subscriptions to pmessage's.
    • observePatterns

      Flux<PatternMessage<K,​V>> observePatterns​(FluxSink.OverflowStrategy overflowStrategy)
      Flux for messages (pmessage) received though pattern subscriptions. The connection needs to be subscribed to one or more patterns using psubscribe(Object[]).
      Parameters:
      overflowStrategy - the overflow strategy to use.
      Returns:
      hot Flux for subscriptions to pmessage's.
    • observeChannels

      Flux<ChannelMessage<K,​V>> observeChannels()
      Flux for messages (message) received though channel subscriptions. The connection needs to be subscribed to one or more channels using subscribe(Object[]).

      Warning! This method uses FluxSink.OverflowStrategy.BUFFER This does unbounded buffering and may lead to OutOfMemoryError. Use observeChannels(FluxSink.OverflowStrategy) to specify a different strategy.

      Returns:
      hot Flux for subscriptions to message's.
    • observeChannels

      Flux<ChannelMessage<K,​V>> observeChannels​(FluxSink.OverflowStrategy overflowStrategy)
      Flux for messages (message) received though channel subscriptions. The connection needs to be subscribed to one or more channels using subscribe(Object[]).
      Parameters:
      overflowStrategy - the overflow strategy to use.
      Returns:
      hot Flux for subscriptions to message's.
    • psubscribe

      Mono<Void> psubscribe​(K... patterns)
      Listen for messages published to channels matching the given patterns. The Mono completes without a result as soon as the pattern subscription is registered.
      Parameters:
      patterns - the patterns.
      Returns:
      Mono<Void> Mono for psubscribe command.
    • punsubscribe

      Mono<Void> punsubscribe​(K... patterns)
      Stop listening for messages posted to channels matching the given patterns. The Mono completes without a result as soon as the pattern subscription is unregistered.
      Parameters:
      patterns - the patterns.
      Returns:
      Mono<Void> Mono for punsubscribe command.
    • subscribe

      Mono<Void> subscribe​(K... channels)
      Listen for messages published to the given channels. The Mono completes without a result as soon as the * subscription is registered.
      Parameters:
      channels - the channels.
      Returns:
      Mono<Void> Mono for subscribe command.
    • unsubscribe

      Mono<Void> unsubscribe​(K... channels)
      Stop listening for messages posted to the given channels. The Mono completes without a result as soon as the subscription is unregistered.
      Parameters:
      channels - the channels.
      Returns:
      Mono<Void> Mono for unsubscribe command.
    • getStatefulConnection

      StatefulRedisPubSubConnection<K,​V> getStatefulConnection()
      Specified by:
      getStatefulConnection in interface RedisReactiveCommands<K,​V>
      Returns:
      the underlying connection.