public interface Subscription
RedisConnection
, it should not be used by multiple
threads. Note that once a subscription died, it cannot accept any more subscriptions.Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown the subscription and free any resources held.
|
Collection<byte[]> |
getChannels()
Returns the (named) channels for this subscription.
|
MessageListener |
getListener()
Returns the listener used for this subscription.
|
Collection<byte[]> |
getPatterns()
Returns the channel patters for this subscription.
|
boolean |
isAlive()
Indicates whether this subscription is still 'alive' or not.
|
void |
pSubscribe(byte[]... patterns)
Adds the given channel patterns to the current subscription.
|
void |
pUnsubscribe()
Cancels the subscription for all channels matched by patterns.
|
void |
pUnsubscribe(byte[]... patterns)
Cancels the subscription for all channels matching the given patterns.
|
void |
subscribe(byte[]... channels)
Adds the given channels to the current subscription.
|
void |
unsubscribe()
Cancels the current subscription for all channels given by name.
|
void |
unsubscribe(byte[]... channels)
Cancels the current subscription for all given channels.
|
void subscribe(byte[]... channels) throws RedisInvalidSubscriptionException
channels
- channel names. Must not be empty.RedisInvalidSubscriptionException
void pSubscribe(byte[]... patterns) throws RedisInvalidSubscriptionException
patterns
- channel patterns. Must not be empty.RedisInvalidSubscriptionException
void unsubscribe()
void unsubscribe(byte[]... channels)
channels
- channel names. Must not be empty.void pUnsubscribe()
void pUnsubscribe(byte[]... patterns)
patterns
- must not be empty.Collection<byte[]> getChannels()
Collection<byte[]> getPatterns()
MessageListener getListener()
boolean isAlive()
void close()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.