K - Key type.V - Value type.public class StatefulRedisPubSubConnectionImpl<K,V> extends StatefulRedisConnectionImpl<K,V> implements StatefulRedisPubSubConnection<K,V>
StatefulRedisPubSubConnectionImpl
A ConnectionWatchdog monitors each connection and reconnects automatically until RedisChannelHandler.close() is called. All
pending commands will be (re)sent after successful reconnection.| Constructor and Description |
|---|
StatefulRedisPubSubConnectionImpl(PubSubEndpoint<K,V> endpoint,
RedisChannelWriter writer,
RedisCodec<K,V> codec,
Duration timeout)
Initialize a new connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activated()
Notification when the connection becomes active (connected).
|
void |
addListener(RedisPubSubListener<K,V> listener)
Add a new listener.
|
RedisPubSubAsyncCommands<K,V> |
async()
Returns the
RedisAsyncCommands API for the current connection. |
protected RedisPubSubAsyncCommandsImpl<K,V> |
newRedisAsyncCommandsImpl()
Create a new instance of
RedisAsyncCommandsImpl. |
protected RedisPubSubReactiveCommandsImpl<K,V> |
newRedisReactiveCommandsImpl()
Create a new instance of
RedisReactiveCommandsImpl. |
protected RedisPubSubCommands<K,V> |
newRedisSyncCommandsImpl()
Create a new instance of
RedisCommands. |
RedisPubSubReactiveCommands<K,V> |
reactive()
Returns the
RedisReactiveCommands API for the current connection. |
void |
removeListener(RedisPubSubListener<K,V> listener)
Remove an existing listener.
|
protected List<RedisFuture<Void>> |
resubscribe()
Re-subscribe to all previously subscribed channels and patterns.
|
RedisPubSubCommands<K,V> |
sync()
Returns the
RedisCommands API for the current connection. |
dispatch, dispatch, isMulti, preProcessCommand, setClientNameaddListener, close, closeAsync, deactivated, flushCommands, getChannelWriter, getOptions, getResources, getTimeout, isClosed, isOpen, registerCloseables, reset, setAutoFlushCommands, setOptions, setTimeout, setTimeout, syncHandlerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisMulticlose, closeAsync, dispatch, dispatch, flushCommands, getOptions, getResources, getTimeout, isOpen, reset, setAutoFlushCommands, setTimeout, setTimeoutpublic StatefulRedisPubSubConnectionImpl(PubSubEndpoint<K,V> endpoint, RedisChannelWriter writer, RedisCodec<K,V> codec, Duration timeout)
endpoint - the PubSubEndpointwriter - the writer used to write commandscodec - Codec used to encode/decode keys and values.timeout - Maximum time to wait for a response.public void addListener(RedisPubSubListener<K,V> listener)
addListener in interface StatefulRedisPubSubConnection<K,V>listener - Listener.public void removeListener(RedisPubSubListener<K,V> listener)
removeListener in interface StatefulRedisPubSubConnection<K,V>listener - Listener.public RedisPubSubAsyncCommands<K,V> async()
StatefulRedisConnectionRedisAsyncCommands API for the current connection. Does not create a new connection.async in interface StatefulRedisConnection<K,V>async in interface StatefulRedisPubSubConnection<K,V>async in class StatefulRedisConnectionImpl<K,V>protected RedisPubSubAsyncCommandsImpl<K,V> newRedisAsyncCommandsImpl()
StatefulRedisConnectionImplRedisAsyncCommandsImpl. Can be overriden to extend.newRedisAsyncCommandsImpl in class StatefulRedisConnectionImpl<K,V>public RedisPubSubCommands<K,V> sync()
StatefulRedisConnectionRedisCommands API for the current connection. Does not create a new connection.sync in interface StatefulRedisConnection<K,V>sync in interface StatefulRedisPubSubConnection<K,V>sync in class StatefulRedisConnectionImpl<K,V>protected RedisPubSubCommands<K,V> newRedisSyncCommandsImpl()
StatefulRedisConnectionImplRedisCommands. Can be overriden to extend.newRedisSyncCommandsImpl in class StatefulRedisConnectionImpl<K,V>public RedisPubSubReactiveCommands<K,V> reactive()
StatefulRedisConnectionRedisReactiveCommands API for the current connection. Does not create a new connection.reactive in interface StatefulRedisConnection<K,V>reactive in interface StatefulRedisPubSubConnection<K,V>reactive in class StatefulRedisConnectionImpl<K,V>protected RedisPubSubReactiveCommandsImpl<K,V> newRedisReactiveCommandsImpl()
StatefulRedisConnectionImplRedisReactiveCommandsImpl. Can be overriden to extend.newRedisReactiveCommandsImpl in class StatefulRedisConnectionImpl<K,V>protected List<RedisFuture<Void>> resubscribe()
public void activated()
RedisChannelHandleractivated in interface ConnectionFacadeactivated in class StatefulRedisConnectionImpl<K,V>Copyright © 2019 lettuce.io. All rights reserved.