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 |
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() |
ClientOptions |
getOptions() |
ClientResources |
getResources() |
Duration |
getTimeout() |
boolean |
isClosed() |
boolean |
isOpen() |
void |
registerCloseables(Collection<Closeable> registry,
Closeable... closeables)
Register Closeable resources.
|
void |
reset()
Reset the connection state.
|
void |
setAutoFlushCommands(boolean autoFlush) |
void |
setOptions(ClientOptions clientOptions) |
void |
setTimeout(Duration timeout)
Set the command timeout for this connection.
|
void |
setTimeout(long timeout,
TimeUnit unit)
Deprecated.
since 5.0, use
setTimeout(Duration) |
protected <T> T |
syncHandler(Object asyncApi,
Class<?>... interfaces) |
public RedisChannelHandler(RedisChannelWriter writer, Duration timeout)
writer - the channel writertimeout - timeout valuepublic void setTimeout(Duration timeout)
timeout - Command timeout.@Deprecated public void setTimeout(long timeout, TimeUnit unit)
setTimeout(Duration)timeout - Command timeout.unit - Unit of time for the 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()
public void reset()
ConnectionFacadereset in interface ConnectionFacadepublic ClientOptions getOptions()
public ClientResources getResources()
public void setOptions(ClientOptions clientOptions)
public Duration getTimeout()
public void setAutoFlushCommands(boolean autoFlush)
public void flushCommands()
Copyright © 2019 lettuce.io. All rights reserved.