final class LettuceRedisConnection<K,V> extends Object implements Connection, io.lettuce.core.api.StatefulRedisConnection<K,V>
StatefulRedisConnection
.
This classes requires a release handle, used when a close is requested.
Instead of actually closing the StatefulRedisConnection
, the
release handle is called.Modifier and Type | Method and Description |
---|---|
io.lettuce.core.api.async.RedisAsyncCommands<K,V> |
async() |
void |
close() |
CompletableFuture<Void> |
closeAsync() |
(package private) static <K,V> LettuceRedisConnection |
create(io.lettuce.core.api.StatefulRedisConnection<K,V> connection,
Consumer<io.lettuce.core.api.StatefulRedisConnection<K,V>> releaseHandle) |
Collection<io.lettuce.core.protocol.RedisCommand<K,V,?>> |
dispatch(Collection<? extends io.lettuce.core.protocol.RedisCommand<K,V,?>> redisCommands) |
<T> io.lettuce.core.protocol.RedisCommand<K,V,T> |
dispatch(io.lettuce.core.protocol.RedisCommand<K,V,T> command) |
void |
flushCommands() |
io.lettuce.core.ClientOptions |
getOptions() |
io.lettuce.core.resource.ClientResources |
getResources() |
Duration |
getTimeout() |
boolean |
isMulti() |
boolean |
isOpen() |
boolean |
isValid(long timeOut,
TimeUnit unit)
Pings the Redis server provided by
RedisDatabase.uri() |
io.lettuce.core.api.reactive.RedisReactiveCommands<K,V> |
reactive() |
void |
reset() |
void |
setAutoFlushCommands(boolean autoFlush) |
void |
setTimeout(Duration timeout) |
void |
setTimeout(long timeout,
TimeUnit unit) |
io.lettuce.core.api.sync.RedisCommands<K,V> |
sync() |
static <K,V> LettuceRedisConnection create(io.lettuce.core.api.StatefulRedisConnection<K,V> connection, Consumer<io.lettuce.core.api.StatefulRedisConnection<K,V>> releaseHandle)
connection
- the redis connectionreleaseHandle
- the consumer to be executed when close is requestedpublic boolean isValid(long timeOut, TimeUnit unit)
RedisDatabase.uri()
Creates a new RedisClient
based on the RedisDatabase.uri()
and sends a
BaseRedisCommands.ping()
command to verify that the server is reachable
isValid
in interface Connection
timeOut
- The time to wait for the database operation used to validate the connection to complete.unit
- time unit of timeOut
public void close() throws DatabaseException
close
in interface io.lettuce.core.api.StatefulConnection<K,V>
close
in interface Connection
close
in interface AutoCloseable
DatabaseException
public CompletableFuture<Void> closeAsync()
public boolean isMulti()
public void setTimeout(Duration timeout)
public void setTimeout(long timeout, TimeUnit unit)
public Duration getTimeout()
public <T> io.lettuce.core.protocol.RedisCommand<K,V,T> dispatch(io.lettuce.core.protocol.RedisCommand<K,V,T> command)
public Collection<io.lettuce.core.protocol.RedisCommand<K,V,?>> dispatch(Collection<? extends io.lettuce.core.protocol.RedisCommand<K,V,?>> redisCommands)
public boolean isOpen()
public io.lettuce.core.ClientOptions getOptions()
public io.lettuce.core.resource.ClientResources getResources()
public void reset()
public void setAutoFlushCommands(boolean autoFlush)
Copyright © 2020. All rights reserved.