Module lettuce.core

Class PubSubOutput<K,​V>

java.lang.Object
io.lettuce.core.output.CommandOutput<K,​V,​V>
io.lettuce.core.pubsub.PubSubOutput<K,​V>
Type Parameters:
K - Key type.
V - Value type.
All Implemented Interfaces:
PubSubMessage<K,​V>

public class PubSubOutput<K,​V>
extends CommandOutput<K,​V,​V>
implements PubSubMessage<K,​V>
One element of the Redis pub/sub stream. May be a message or notification of subscription details.
Author:
Will Glozer, Mark Paluch
  • Constructor Details

    • PubSubOutput

      public PubSubOutput​(RedisCodec<K,​V> codec)
  • Method Details

    • type

      public PubSubOutput.Type type()
      Specified by:
      type in interface PubSubMessage<K,​V>
      Returns:
      the PubSubOutput.Type message type.
    • channel

      public K channel()
      Specified by:
      channel in interface PubSubMessage<K,​V>
      Returns:
      name of the channel to which this notification belongs to.
    • pattern

      public K pattern()
      Specified by:
      pattern in interface PubSubMessage<K,​V>
      Returns:
      pattern that applies if the message was received through a pattern subscription. Can be null.
    • count

      public long count()
      Specified by:
      count in interface PubSubMessage<K,​V>
      Returns:
      the subscriber count if applicable.
    • set

      public void set​(ByteBuffer bytes)
      Description copied from class: CommandOutput
      Update the command output with a sequence of bytes, or null. Concrete CommandOutput implementations must override this method to decode bulk/bytes response values.
      Overrides:
      set in class CommandOutput<K,​V,​V>
      Parameters:
      bytes - The command output, or null.
    • set

      public void set​(long integer)
      Description copied from class: CommandOutput
      Update the command output with a 64-bit signed integer. Concrete CommandOutput implementations must override this method to decode number (integer) response values.
      Overrides:
      set in class CommandOutput<K,​V,​V>
      Parameters:
      integer - The command output.
    • body

      public V body()
      Specified by:
      body in interface PubSubMessage<K,​V>
      Returns:
      the message body, if applicable. Can be null.