Interface ReactivePubSubCommands
public interface ReactivePubSubCommands
Redis Pub/Sub commands executed using reactive infrastructure.
- Since:
- 2.1
- Author:
- Mark Paluch, Christoph Strobl
- 
Method SummaryModifier and TypeMethodDescriptiondefault reactor.core.publisher.Mono<ReactiveSubscription>Creates a subscription for this connection.reactor.core.publisher.Mono<ReactiveSubscription>createSubscription(SubscriptionListener subscriptionListener) Creates a subscription for this connection.reactor.core.publisher.Mono<Void>pSubscribe(ByteBuffer... patterns) Subscribes the connection to all channels matching the givenpatterns.default reactor.core.publisher.Mono<Long>publish(ByteBuffer channel, ByteBuffer message) Publishes the givenmessageto the givenchannel.reactor.core.publisher.Flux<Long>publish(org.reactivestreams.Publisher<ReactiveSubscription.ChannelMessage<ByteBuffer, ByteBuffer>> messageStream) Publishes the given messages to theappropriate channels.reactor.core.publisher.Mono<Void>subscribe(ByteBuffer... channels) Subscribes the connection to the givenchannels.
- 
Method Details- 
createSubscriptionCreates a subscription for this connection. Connections can have multipleReactiveSubscriptions.Use createSubscription(SubscriptionListener)to get notified when the subscription completes.- Returns:
- the subscription.
 
- 
createSubscriptionreactor.core.publisher.Mono<ReactiveSubscription> createSubscription(SubscriptionListener subscriptionListener) Creates a subscription for this connection. Connections can have multipleReactiveSubscriptions.- Parameters:
- subscriptionListener- the subscription listener to listen for subscription confirmations.
- Returns:
- the subscription.
- Since:
- 2.6
 
- 
publishPublishes the givenmessageto the givenchannel.- 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:
 
- 
publishreactor.core.publisher.Flux<Long> publish(org.reactivestreams.Publisher<ReactiveSubscription.ChannelMessage<ByteBuffer, ByteBuffer>> messageStream) Publishes the given messages to theappropriate channels.- Parameters:
- messageStream- the messages to publish to. Must not be null.
- Returns:
- the number of clients that received the message.
- See Also:
 
- 
subscribeSubscribes the connection to the givenchannels. 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 Fluxwill unsubscribe fromchannels.- Parameters:
- channels- channel names, must not be null.
- See Also:
 
- 
pSubscribeSubscribes the connection to all channels matching the givenpatterns. 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 Fluxwill unsubscribe frompatterns.- Parameters:
- patterns- channel name patterns, must not be null.
- See Also:
 
 
-