@Experimental public interface BaseRedisClient extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(CommandListener listener)
Add a listener for Redis Command events.
|
void |
addListener(RedisConnectionStateListener listener)
Add a listener for the RedisConnectionState.
|
ClientOptions |
getOptions()
Returns the
ClientOptions which are valid for that client. |
ClientResources |
getResources()
Returns the
ClientResources which are used with that client. |
void |
removeListener(CommandListener listener)
Removes a listener.
|
void |
removeListener(RedisConnectionStateListener listener)
Removes a listener.
|
void |
shutdown()
Shutdown this client and close all open connections once this method is called.
|
void |
shutdown(Duration quietPeriod,
Duration timeout)
Shutdown this client and close all open connections once this method is called.
|
void |
shutdown(long quietPeriod,
long timeout,
TimeUnit timeUnit)
Shutdown this client and close all open connections once this method is called.
|
CompletableFuture<Void> |
shutdownAsync()
Shutdown this client and close all open connections asynchronously.
|
CompletableFuture<Void> |
shutdownAsync(long quietPeriod,
long timeout,
TimeUnit timeUnit)
Shutdown this client and close all open connections asynchronously.
|
closeClientOptions getOptions()
ClientOptions which are valid for that client. Connections inherit the current options at the moment
the connection is created. Changes to options will not affect existing connections.ClientOptions for this clientClientResources getResources()
ClientResources which are used with that client.ClientResources for this client.void addListener(RedisConnectionStateListener listener)
listener - must not be null.void removeListener(RedisConnectionStateListener listener)
listener - must not be null.void addListener(CommandListener listener)
listener - must not be null.void removeListener(CommandListener listener)
listener - must not be null.void shutdown()
ClientResources are shut down/released gracefully considering quiet time and the shutdown timeout. The
client should be discarded after calling shutdown. The shutdown is executed without quiet time and a timeout of 2
TimeUnit.SECONDS.void shutdown(Duration quietPeriod, Duration timeout)
ClientResources are shut down/released gracefully considering quiet time and the shutdown timeout. The
client should be discarded after calling shutdown.quietPeriod - the quiet period to allow the executor gracefully shut down.timeout - the maximum amount of time to wait until the backing executor is shutdown regardless if a task was
submitted during the quiet period.EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)void shutdown(long quietPeriod,
long timeout,
TimeUnit timeUnit)
ClientResources are shut down/released gracefully considering quiet time and the shutdown timeout. The
client should be discarded after calling shutdown.quietPeriod - the quiet period to allow the executor gracefully shut down.timeout - the maximum amount of time to wait until the backing executor is shutdown regardless if a task was
submitted during the quiet period.timeUnit - the unit of quietPeriod and timeout.EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)CompletableFuture<Void> shutdownAsync()
ClientResources are shut down/released gracefully considering quiet time and the shutdown timeout. The client
should be discarded after calling shutdown. The shutdown is executed without quiet time and a timeout of 2
TimeUnit.SECONDS.EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)CompletableFuture<Void> shutdownAsync(long quietPeriod, long timeout, TimeUnit timeUnit)
ClientResources are shut down/released gracefully considering quiet time and the shutdown timeout. The client
should be discarded after calling shutdown.quietPeriod - the quiet period to allow the executor gracefully shut down.timeout - the maximum amount of time to wait until the backing executor is shutdown regardless if a task was
submitted during the quiet period.timeUnit - the unit of quietPeriod and timeout.EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)Copyright © 2025 lettuce.io. All rights reserved.