Class LettuceSubscription
java.lang.Object
org.springframework.data.redis.connection.util.AbstractSubscription
org.springframework.data.redis.connection.lettuce.LettuceSubscription
- All Implemented Interfaces:
Subscription
Message subscription on top of Lettuce.
- Author:
- Costin Leau, Mark Paluch, Christoph Strobl, Sarah Abbey, Murtuza Boxwala, Jens Deppe
-
Constructor Summary
ModifierConstructorDescriptionprotected
LettuceSubscription
(MessageListener listener, io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[], byte[]> pubsubConnection, LettuceConnectionProvider connectionProvider) Creates a newLettuceSubscription
givenMessageListener
,StatefulRedisPubSubConnection
, andLettuceConnectionProvider
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doClose()
Shutdown the subscription and free any resources held.protected void
doPsubscribe
(byte[]... patterns) Subscribe to the given patternsprotected void
doPUnsubscribe
(boolean all, byte[]... patterns) Pattern unsubscribe.protected void
doSubscribe
(byte[]... channels) Subscribe to the given channels.protected void
doUnsubscribe
(boolean all, byte[]... channels) Channel unsubscribe.protected io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[],
byte[]> Methods inherited from class org.springframework.data.redis.connection.util.AbstractSubscription
close, getChannels, getListener, getPatterns, isAlive, pSubscribe, pUnsubscribe, pUnsubscribe, subscribe, unsubscribe, unsubscribe
-
Constructor Details
-
LettuceSubscription
protected LettuceSubscription(MessageListener listener, io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[], byte[]> pubsubConnection, LettuceConnectionProvider connectionProvider) Creates a newLettuceSubscription
givenMessageListener
,StatefulRedisPubSubConnection
, andLettuceConnectionProvider
.- Parameters:
listener
- the listener to notify, must not be null.pubsubConnection
- must not be null.connectionProvider
- must not be null.
-
-
Method Details
-
getNativeConnection
protected io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[],byte[]> getNativeConnection() -
doClose
protected void doClose()Description copied from class:AbstractSubscription
Shutdown the subscription and free any resources held.- Specified by:
doClose
in classAbstractSubscription
-
doPsubscribe
protected void doPsubscribe(byte[]... patterns) Description copied from class:AbstractSubscription
Subscribe to the given patterns- Specified by:
doPsubscribe
in classAbstractSubscription
- Parameters:
patterns
- patterns to subscribe to
-
doPUnsubscribe
protected void doPUnsubscribe(boolean all, byte[]... patterns) Description copied from class:AbstractSubscription
Pattern unsubscribe.- Specified by:
doPUnsubscribe
in classAbstractSubscription
- Parameters:
all
- true if all the patterns are unsubscribed (used as a hint for the underlying implementation).patterns
- patterns to be unsubscribed
-
doSubscribe
protected void doSubscribe(byte[]... channels) Description copied from class:AbstractSubscription
Subscribe to the given channels.- Specified by:
doSubscribe
in classAbstractSubscription
- Parameters:
channels
- channels to subscribe to
-
doUnsubscribe
protected void doUnsubscribe(boolean all, byte[]... channels) Description copied from class:AbstractSubscription
Channel unsubscribe.- Specified by:
doUnsubscribe
in classAbstractSubscription
- Parameters:
all
- true if all the channels are unsubscribed (used as a hint for the underlying implementation).channels
- channels to be unsubscribed
-