Module lettuce.core

Interface RedisPubSubCommands<K,​V>

Type Parameters:
K - Key type.
V - Value type.
All Superinterfaces:
BaseRedisCommands<K,​V>, RedisAclCommands<K,​V>, RedisClusterCommands<K,​V>, RedisCommands<K,​V>, RedisGeoCommands<K,​V>, RedisHashCommands<K,​V>, RedisHLLCommands<K,​V>, RedisKeyCommands<K,​V>, RedisListCommands<K,​V>, RedisScriptingCommands<K,​V>, RedisServerCommands<K,​V>, RedisSetCommands<K,​V>, RedisSortedSetCommands<K,​V>, RedisStreamCommands<K,​V>, RedisStringCommands<K,​V>, RedisTransactionalCommands<K,​V>
All Known Subinterfaces:
RedisClusterPubSubCommands<K,​V>

public interface RedisPubSubCommands<K,​V>
extends RedisCommands<K,​V>
Synchronous and thread-safe Redis PubSub API.
Since:
4.0
Author:
Mark Paluch
  • Method Details

    • psubscribe

      void psubscribe​(K... patterns)
      Listen for messages published to channels matching the given patterns.
      Parameters:
      patterns - the patterns
    • punsubscribe

      void punsubscribe​(K... patterns)
      Stop listening for messages posted to channels matching the given patterns.
      Parameters:
      patterns - the patterns
    • subscribe

      void subscribe​(K... channels)
      Listen for messages published to the given channels.
      Parameters:
      channels - the channels
    • unsubscribe

      void unsubscribe​(K... channels)
      Stop listening for messages posted to the given channels.
      Parameters:
      channels - the channels
    • getStatefulConnection

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