Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public StatefulRedisConnectionImpl(RedisChannelWriter writer, PushHandler pushHa
this.reactive = newRedisReactiveCommandsImpl();
}

@Override
public RedisCodec<K, V> getCodec() {
return codec;
}
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/io/lettuce/core/api/StatefulConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import io.lettuce.core.ClientOptions;
import io.lettuce.core.RedisConnectionStateListener;
import io.lettuce.core.codec.RedisCodec;
import io.lettuce.core.protocol.RedisCommand;
import io.lettuce.core.resource.ClientResources;

Expand Down Expand Up @@ -81,7 +82,7 @@ public interface StatefulConnection<K, V> extends AutoCloseable, AsyncCloseable
* connection will become not usable anymore as soon as this method was called.
*
* @return a {@link CompletableFuture} that is notified once the operation completes, either because the operation was
* successful or because of an error.
* successful or because of an error.
* @since 5.1
*/
@Override
Expand Down Expand Up @@ -117,4 +118,9 @@ public interface StatefulConnection<K, V> extends AutoCloseable, AsyncCloseable
*/
void flushCommands();

/**
* @return the codec used for this connection.
*/
RedisCodec<K, V> getCodec();

}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public StatefulRedisClusterConnectionImpl(RedisChannelWriter writer, ClusterPush
this.reactive = newRedisAdvancedClusterReactiveCommandsImpl();
}

@Override
public RedisCodec<K, V> getCodec() {
return codec;
}

protected RedisAdvancedClusterReactiveCommandsImpl<K, V> newRedisAdvancedClusterReactiveCommandsImpl() {
return new RedisAdvancedClusterReactiveCommandsImpl<>((StatefulRedisClusterConnection<K, V>) this, codec, parser);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ public ConnectionState getConnectionState() {
return connectionState;
}

@Override
public RedisCodec<K, V> getCodec() {
return codec;
}

static class SentinelConnectionState extends ConnectionState {

@Override
Expand Down
Loading