public class CommandListenerWriter extends Object implements RedisChannelWriter
| Modifier and Type | Class and Description |
|---|---|
static class |
CommandListenerWriter.CommandListenerMulticaster
Wraps multiple command listeners into one multicaster.
|
| Constructor and Description |
|---|
CommandListenerWriter(RedisChannelWriter delegate,
List<CommandListener> listeners) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Void> |
closeAsync()
Asynchronously close the
RedisChannelWriter. |
void |
flushCommands()
Flush pending commands.
|
ClientResources |
getClientResources() |
RedisChannelWriter |
getDelegate() |
static boolean |
isSupported(List<CommandListener> commandListeners)
Check whether the list of
CommandListener is not empty. |
void |
reset()
Reset the command state.
|
void |
setAutoFlushCommands(boolean autoFlush)
Disable or enable auto-flush behavior.
|
void |
setConnectionFacade(ConnectionFacade connection)
Set the corresponding connection facade in order to notify it about channel active/inactive state.
|
<K,V> Collection<RedisCommand<K,V,?>> |
write(Collection<? extends RedisCommand<K,V,?>> redisCommands)
Write multiple commands on the channel.
|
<K,V,T> RedisCommand<K,V,T> |
write(RedisCommand<K,V,T> command)
Write a command on the channel.
|
public CommandListenerWriter(RedisChannelWriter delegate, List<CommandListener> listeners)
public static boolean isSupported(List<CommandListener> commandListeners)
CommandListener is not empty.commandListeners - must not be null.true if the list of CommandListener is not empty.public <K,V,T> RedisCommand<K,V,T> write(RedisCommand<K,V,T> command)
RedisChannelWriterwrite in interface RedisChannelWriterT - result typecommand - the Redis command.public <K,V> Collection<RedisCommand<K,V,?>> write(Collection<? extends RedisCommand<K,V,?>> redisCommands)
RedisChannelWriterwrite in interface RedisChannelWriterK - key typeV - value typeredisCommands - the Redis commands.public void close()
close in interface RedisChannelWriterclose in interface Closeableclose in interface AutoCloseablepublic CompletableFuture<Void> closeAsync()
RedisChannelWriterRedisChannelWriter.closeAsync in interface AsyncCloseablecloseAsync in interface RedisChannelWriterpublic void reset()
RedisChannelWriterreset in interface RedisChannelWriterpublic void setConnectionFacade(ConnectionFacade connection)
RedisChannelWritersetConnectionFacade in interface RedisChannelWriterconnection - the connection facade (external connection object)public void setAutoFlushCommands(boolean autoFlush)
RedisChannelWritertrue. If autoFlushCommands is disabled, multiple commands
can be issued without writing them actually to the transport. Commands are buffered until a RedisChannelWriter.flushCommands() is
issued. After calling RedisChannelWriter.flushCommands() commands are sent to the transport and executed by Redis.setAutoFlushCommands in interface RedisChannelWriterautoFlush - state of autoFlush.public void flushCommands()
RedisChannelWriterflushCommands in interface RedisChannelWriterpublic ClientResources getClientResources()
getClientResources in interface RedisChannelWriterClientResources.public RedisChannelWriter getDelegate()
Copyright © 2024 lettuce.io. All rights reserved.