Interface LettuceConnectionProvider.TargetAware
- Enclosing interface:
- LettuceConnectionProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Extension to
LettuceConnectionProvider
for providers that allow connection creation to specific nodes.-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends io.lettuce.core.api.StatefulConnection<?,
?>>
TgetConnection
(Class<T> connectionType, io.lettuce.core.RedisURI redisURI) Request a connection givenconnectionType
for a specificRedisURI
.<T extends io.lettuce.core.api.StatefulConnection<?,
?>>
CompletionStage<T>getConnectionAsync
(Class<T> connectionType, io.lettuce.core.RedisURI redisURI) Request asynchronously a connection givenconnectionType
for a specificRedisURI
.
-
Method Details
-
getConnection
default <T extends io.lettuce.core.api.StatefulConnection<?,?>> T getConnection(Class<T> connectionType, io.lettuce.core.RedisURI redisURI) Request a connection givenconnectionType
for a specificRedisURI
. Providing a connection type allows specialization to provide a more specific connection type.- Parameters:
connectionType
- must not be null.redisURI
- must not be null.- Returns:
- the requested connection.
-
getConnectionAsync
<T extends io.lettuce.core.api.StatefulConnection<?,?>> CompletionStage<T> getConnectionAsync(Class<T> connectionType, io.lettuce.core.RedisURI redisURI) Request asynchronously a connection givenconnectionType
for a specificRedisURI
. Providing a connection type allows specialization to provide a more specific connection type.- Parameters:
connectionType
- must not be null.redisURI
- must not be null.- Returns:
- a
CompletionStage
that is notified with the connection progress. - Since:
- 2.2
-