Interface ReactivePubSubCommands
public interface ReactivePubSubCommands
Redis Pub/Sub commands executed using reactive infrastructure.
- Since:
- 2.1
- Author:
- Mark Paluch, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptiondefault Mono<ReactiveSubscription>Creates a subscription for this connection.createSubscription(SubscriptionListener subscriptionListener) Creates a subscription for this connection.pSubscribe(ByteBuffer... patterns) Subscribes the connection to all channels matching the givenpatterns.publish(ByteBuffer channel, ByteBuffer message) Publishes the givenmessageto the givenchannel.publish(Publisher<ReactiveSubscription.ChannelMessage<ByteBuffer, ByteBuffer>> messageStream) Publishes the given messages to theappropriate channels.subscribe(ByteBuffer... channels) Subscribes the connection to the givenchannels.
-
Method Details
-
createSubscription
Creates a subscription for this connection. Connections can have multipleReactiveSubscriptions.Use
createSubscription(SubscriptionListener)to get notified when the subscription completes.- Returns:
- the subscription.
-
createSubscription
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
-
publish
Publishes 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:
-
publish
Flux<Long> publish(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:
-
subscribe
Subscribes 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:
-
pSubscribe
Subscribes 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:
-