Interface ReactivePubSubCommands


public interface ReactivePubSubCommands
Redis Pub/Sub commands executed using reactive infrastructure.
Since:
2.1
Author:
Mark Paluch, Christoph Strobl
  • Method Details

    • createSubscription

      default reactor.core.publisher.Mono<ReactiveSubscription> createSubscription()
      Creates a subscription for this connection. Connections can have multiple ReactiveSubscriptions.

      Use createSubscription(SubscriptionListener) to get notified when the subscription completes.

      Returns:
      the subscription.
    • createSubscription

      reactor.core.publisher.Mono<ReactiveSubscription> createSubscription(SubscriptionListener subscriptionListener)
      Creates a subscription for this connection. Connections can have multiple ReactiveSubscriptions.
      Parameters:
      subscriptionListener - the subscription listener to listen for subscription confirmations.
      Returns:
      the subscription.
      Since:
      2.6
    • publish

      default reactor.core.publisher.Mono<Long> publish(ByteBuffer channel, ByteBuffer message)
      Publishes the given message to the given channel.
      Parameters:
      channel - the channel to publish to. Must not be null.
      message - message to publish. Must not be null.
      Returns:
      the number of clients that received the message.
      See Also:
    • publish

      reactor.core.publisher.Flux<Long> publish(org.reactivestreams.Publisher<ReactiveSubscription.ChannelMessage<ByteBuffer,ByteBuffer>> messageStream)
      Publishes the given messages to the appropriate channels.
      Parameters:
      messageStream - the messages to publish to. Must not be null.
      Returns:
      the number of clients that received the message.
      See Also:
    • subscribe

      reactor.core.publisher.Mono<Void> subscribe(ByteBuffer... channels)
      Subscribes the connection to the given channels. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.

      Note that cancellation of the Flux will unsubscribe from channels.

      Parameters:
      channels - channel names, must not be null.
      See Also:
    • pSubscribe

      reactor.core.publisher.Mono<Void> pSubscribe(ByteBuffer... patterns)
      Subscribes the connection to all channels matching the given patterns. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.

      Note that cancellation of the Flux will unsubscribe from patterns.

      Parameters:
      patterns - channel name patterns, must not be null.
      See Also: