K - Key type.V - Value type.public abstract class RedisChannelHandler<K,V> extends Object implements Closeable, ConnectionFacade
| Constructor and Description |
|---|
RedisChannelHandler(RedisChannelWriter writer,
Duration timeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
activated()
Notification when the connection becomes active (connected).
|
protected void |
addListener(io.lettuce.core.CloseEvents.CloseListener listener) |
void |
addListener(RedisConnectionStateListener listener)
Add a listener for the
RedisConnectionStateListener. |
void |
close()
Close the connection (synchronous).
|
CompletableFuture<Void> |
closeAsync()
Close the connection (asynchronous).
|
void |
deactivated()
Notification when the connection becomes inactive (disconnected).
|
protected Collection<RedisCommand<K,V,?>> |
dispatch(Collection<? extends RedisCommand<K,V,?>> commands) |
protected <T> RedisCommand<K,V,T> |
dispatch(RedisCommand<K,V,T> cmd) |
void |
flushCommands() |
RedisChannelWriter |
getChannelWriter() |
ConnectionEvents |
getConnectionEvents() |
ClientOptions |
getOptions() |
ClientResources |
getResources() |
Duration |
getTimeout() |
boolean |
isClosed() |
boolean |
isOpen() |
void |
registerCloseables(Collection<Closeable> registry,
Closeable... closeables)
Register Closeable resources.
|
void |
removeListener(RedisConnectionStateListener listener)
Removes a listener.
|
void |
reset()
Deprecated.
|
void |
setAutoFlushCommands(boolean autoFlush) |
void |
setOptions(ClientOptions clientOptions) |
void |
setTimeout(Duration timeout)
Set the command timeout for this connection.
|
protected <T> T |
syncHandler(Object asyncApi,
Class<?>... interfaces) |
public RedisChannelHandler(RedisChannelWriter writer, Duration timeout)
writer - the channel writertimeout - timeout valuepublic void addListener(RedisConnectionStateListener listener)
RedisConnectionStateListener. The listener is notified every time a connect/disconnect/IO
exception happens. The listener is called on the event loop thread so code within the listener methods must not block.listener - must not be null.public void removeListener(RedisConnectionStateListener listener)
listener - must not be null.public void setTimeout(Duration timeout)
timeout - Command timeout.public void close()
close in interface Closeableclose in interface AutoCloseablepublic CompletableFuture<Void> closeAsync()
protected <T> RedisCommand<K,V,T> dispatch(RedisCommand<K,V,T> cmd)
protected Collection<RedisCommand<K,V,?>> dispatch(Collection<? extends RedisCommand<K,V,?>> commands)
public void registerCloseables(Collection<Closeable> registry, Closeable... closeables)
registry - registry of closeablescloseables - closeables to registerprotected void addListener(io.lettuce.core.CloseEvents.CloseListener listener)
public boolean isClosed()
public void activated()
activated in interface ConnectionFacadepublic void deactivated()
deactivated in interface ConnectionFacadepublic RedisChannelWriter getChannelWriter()
public boolean isOpen()
@Deprecated public void reset()
ConnectionFacadereset in interface ConnectionFacadepublic ConnectionEvents getConnectionEvents()
public ClientOptions getOptions()
public ClientResources getResources()
public void setOptions(ClientOptions clientOptions)
public Duration getTimeout()
public void setAutoFlushCommands(boolean autoFlush)
public void flushCommands()
Copyright © 2022 lettuce.io. All rights reserved.