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()
Deprecated.
|
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 Closeable
close
in interface AutoCloseable
public 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 ConnectionFacade
public void deactivated()
deactivated
in interface ConnectionFacade
public RedisChannelWriter getChannelWriter()
public boolean isOpen()
@Deprecated public void reset()
ConnectionFacade
reset
in interface ConnectionFacade
public 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.