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
ConstructorsModifierConstructorDescriptionprotectedLettuceSubscription(MessageListener listener, io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[], byte[]> pubsubConnection, LettuceConnectionProvider connectionProvider) Creates a newLettuceSubscriptiongivenMessageListener,StatefulRedisPubSubConnection, andLettuceConnectionProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoClose()Shutdown the subscription and free any resources held.protected voiddoPsubscribe(byte[]... patterns) Subscribe to the given patternsprotected voiddoPUnsubscribe(boolean all, byte[]... patterns) Pattern unsubscribe.protected voiddoSubscribe(byte[]... channels) Subscribe to the given channels.protected voiddoUnsubscribe(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 newLettuceSubscriptiongivenMessageListener,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:AbstractSubscriptionShutdown the subscription and free any resources held.- Specified by:
doClosein classAbstractSubscription
-
doPsubscribe
protected void doPsubscribe(byte[]... patterns) Description copied from class:AbstractSubscriptionSubscribe to the given patterns- Specified by:
doPsubscribein classAbstractSubscription- Parameters:
patterns- patterns to subscribe to
-
doPUnsubscribe
protected void doPUnsubscribe(boolean all, byte[]... patterns) Description copied from class:AbstractSubscriptionPattern unsubscribe.- Specified by:
doPUnsubscribein 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:AbstractSubscriptionSubscribe to the given channels.- Specified by:
doSubscribein classAbstractSubscription- Parameters:
channels- channels to subscribe to
-
doUnsubscribe
protected void doUnsubscribe(boolean all, byte[]... channels) Description copied from class:AbstractSubscriptionChannel unsubscribe.- Specified by:
doUnsubscribein classAbstractSubscription- Parameters:
all- true if all the channels are unsubscribed (used as a hint for the underlying implementation).channels- channels to be unsubscribed
-