public class LettuceRedisPubSubConnection<K,V> extends Object implements StatefulRedisPubSubConnection<K,V>
Constructor and Description |
---|
LettuceRedisPubSubConnection(org.apache.commons.pool2.impl.GenericObjectPool<StatefulRedisPubSubConnection<K,V>> connectionPool,
RedisDatabase config) |
LettuceRedisPubSubConnection(StatefulRedisConnection<K,V> connection,
RedisDatabase config) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isMulti
close, closeAsync, dispatch, flushCommands, getResources, getTimeout, isOpen, reset, setAutoFlushCommands, setTimeout, setTimeout
public LettuceRedisPubSubConnection(org.apache.commons.pool2.impl.GenericObjectPool<StatefulRedisPubSubConnection<K,V>> connectionPool, RedisDatabase config) throws Exception
Exception
public LettuceRedisPubSubConnection(StatefulRedisConnection<K,V> connection, RedisDatabase config)
static <K,V> LettuceRedisPubSubConnection<K,V> create(StatefulRedisPubSubConnection<K,V> connection, RedisDatabase config)
static <K,V> LettuceRedisPubSubConnection<K,V> create(org.apache.commons.pool2.impl.GenericObjectPool<StatefulRedisPubSubConnection<K,V>> connectionPool, RedisDatabase config) throws Exception
Exception
public RedisPubSubCommands<K,V> sync()
sync
in interface StatefulRedisConnection<K,V>
sync
in interface StatefulRedisPubSubConnection<K,V>
public RedisPubSubAsyncCommands<K,V> async()
async
in interface StatefulRedisConnection<K,V>
async
in interface StatefulRedisPubSubConnection<K,V>
public RedisPubSubReactiveCommands<K,V> reactive()
reactive
in interface StatefulRedisConnection<K,V>
reactive
in interface StatefulRedisPubSubConnection<K,V>
public void addListener(RedisPubSubListener<K,V> listener)
addListener
in interface StatefulRedisPubSubConnection<K,V>
public void removeListener(RedisPubSubListener<K,V> listener)
removeListener
in interface StatefulRedisPubSubConnection<K,V>
public Collection<RedisCommand<K,V,?>> dispatch(Collection<? extends RedisCommand<K,V,?>> collection)
dispatch
in interface StatefulConnection<K,V>
public ClientOptions getOptions()
getOptions
in interface StatefulConnection<K,V>
public 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 StatefulConnection<K,V>
close
in interface Connection
close
in interface AutoCloseable
DatabaseException
public boolean isMulti()
isMulti
in interface StatefulRedisConnection<K,V>
public void setTimeout(Duration timeout)
setTimeout
in interface StatefulConnection<K,V>
public void setTimeout(long timeout, TimeUnit unit)
setTimeout
in interface StatefulConnection<K,V>
public Duration getTimeout()
getTimeout
in interface StatefulConnection<K,V>
public <T> RedisCommand<K,V,T> dispatch(RedisCommand<K,V,T> command)
dispatch
in interface StatefulConnection<K,V>
public CompletableFuture<Void> closeAsync()
closeAsync
in interface StatefulConnection<K,V>
closeAsync
in interface AsyncCloseable
public boolean isOpen()
isOpen
in interface StatefulConnection<K,V>
public ClientResources getResources()
getResources
in interface StatefulConnection<K,V>
public void reset()
reset
in interface StatefulConnection<K,V>
public void setAutoFlushCommands(boolean autoFlush)
setAutoFlushCommands
in interface StatefulConnection<K,V>
public void flushCommands()
flushCommands
in interface StatefulConnection<K,V>
public C getDelegate()
Copyright © 2020. All rights reserved.