K
- Key type.V
- Value type.public interface StatefulConnection<K,V> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
Collection<RedisCommand<K,V,?>> |
dispatch(Collection<? extends RedisCommand<K,V,?>> commands)
Dispatch multiple command in a single write on the channel.
|
<T> RedisCommand<K,V,T> |
dispatch(RedisCommand<K,V,T> command)
Dispatch a command.
|
void |
flushCommands()
Flush pending commands.
|
ClientOptions |
getOptions() |
long |
getTimeout() |
TimeUnit |
getTimeoutUnit() |
boolean |
isOpen() |
void |
reset()
Reset the command state.
|
void |
setAutoFlushCommands(boolean autoFlush)
Disable or enable auto-flush behavior.
|
void |
setTimeout(long timeout,
TimeUnit unit)
Set the default command timeout for this connection.
|
void setTimeout(long timeout, TimeUnit unit)
timeout
- Command timeout.unit
- Unit of time for the timeout.TimeUnit getTimeoutUnit()
long getTimeout()
<T> RedisCommand<K,V,T> dispatch(RedisCommand<K,V,T> command)
T
- result typecommand
- the Redis command.Collection<RedisCommand<K,V,?>> dispatch(Collection<? extends RedisCommand<K,V,?>> commands)
commands
- the Redis commands.void close()
close
in interface AutoCloseable
boolean isOpen()
ClientOptions getOptions()
void reset()
void setAutoFlushCommands(boolean autoFlush)
flushCommands()
is
issued. After calling flushCommands()
commands are sent to the transport and executed by Redis.autoFlush
- state of autoFlush.void flushCommands()
Copyright © 2017 lettuce.io. All rights reserved.