K
- Key type.V
- Value type.public interface StatefulConnection<K,V> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
<T,C extends RedisCommand<K,V,T>> |
dispatch(C 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,C extends RedisCommand<K,V,T>> C dispatch(C command)
T
- result typeC
- command typecommand
- the Redis commandvoid 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 © 2016. All rights reserved.