public interface RedisPubSubCommands
Modifier and Type | Method and Description |
---|---|
Subscription |
getSubscription()
Returns the current subscription for this connection or null if the connection is not subscribed.
|
boolean |
isSubscribed()
Indicates whether the current connection is subscribed (to at least one channel) or not.
|
void |
pSubscribe(MessageListener listener,
byte[]... patterns)
Subscribes the connection to all channels matching the given patterns.
|
Long |
publish(byte[] channel,
byte[] message)
Publishes the given message to the given channel.
|
void |
subscribe(MessageListener listener,
byte[]... channels)
Subscribes the connection to the given channels.
|
boolean isSubscribed()
@Nullable Subscription getSubscription()
@Nullable Long publish(byte[] channel, byte[] message)
channel
- the channel to publish to. Must not be null.message
- message to publish. Must not be null.void subscribe(MessageListener listener, byte[]... channels)
Note that this operation is blocking and the current thread starts waiting for new messages immediately.
listener
- message listener, must not be null.channels
- channel names, must not be null.void pSubscribe(MessageListener listener, byte[]... patterns)
Note that this operation is blocking and the current thread starts waiting for new messages immediately.
listener
- message listener, must not be null.patterns
- channel name patterns, must not be null.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.