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 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 closeables.closeables - closeables to register.protected void addListener(io.lettuce.core.CloseEvents.CloseListener listener)
public boolean isClosed()
true if the connection is closed (final state in the connection lifecyle).public void activated()
activated in interface ConnectionFacadepublic void deactivated()
deactivated in interface ConnectionFacadepublic RedisChannelWriter getChannelWriter()
public boolean isOpen()
true if the connection is active and not closed.@Deprecated 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 © 2020 lettuce.io. All rights reserved.