K
- Key type.V
- Value type.public abstract class RedisChannelHandler<K,V> extends Object implements Closeable, ConnectionFacade
Constructor and Description |
---|
RedisChannelHandler(RedisChannelWriter writer,
long timeout,
TimeUnit unit) |
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.
|
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() |
long |
getTimeout() |
TimeUnit |
getTimeoutUnit() |
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(long timeout,
TimeUnit unit)
Set the command timeout for this connection.
|
protected <T> T |
syncHandler(Object asyncApi,
Class<?>... interfaces) |
public RedisChannelHandler(RedisChannelWriter writer, long timeout, TimeUnit unit)
writer
- the channel writertimeout
- timeout valueunit
- unit of the timeoutpublic void setTimeout(long timeout, TimeUnit unit)
timeout
- Command timeout.unit
- Unit of time for the timeout.public void close()
close
in interface Closeable
close
in interface AutoCloseable
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 ConnectionFacade
public void deactivated()
deactivated
in interface ConnectionFacade
public RedisChannelWriter getChannelWriter()
public boolean isOpen()
public void reset()
ConnectionFacade
reset
in interface ConnectionFacade
public ClientOptions getOptions()
public void setOptions(ClientOptions clientOptions)
public long getTimeout()
public TimeUnit getTimeoutUnit()
public void setAutoFlushCommands(boolean autoFlush)
public void flushCommands()
Copyright © 2017 lettuce.io. All rights reserved.