newStatefulRedisConnection(Re
return new StatefulRedisConnectionImpl<>(channelWriter, pushHandler, codec, timeout, parser);
}
+ /**
+ * Create a new instance of {@link StatefulRedisConnectionImpl} or a subclass.
+ *
+ * Subclasses of {@link RedisClusterClient} may override that method.
+ *
+ * @param channelWriter the channel writer
+ * @param pushHandler the handler for push notifications
+ * @param codec codec
+ * @param timeout default timeout
+ * @param Key-Type
+ * @param Value Type
+ * @return new instance of StatefulRedisConnectionImpl
+ */
+ protected StatefulRedisConnectionImpl newStatefulRedisConnection(RedisChannelWriter channelWriter,
+ PushHandler pushHandler, RedisCodec codec, Duration timeout) {
+ return new StatefulRedisConnectionImpl<>(channelWriter, pushHandler, codec, timeout);
+ }
+
/**
* Create a pub/sub connection to a redis socket address.
*
@@ -712,6 +730,24 @@ protected StatefulRedisClusterConnectionImpl newStatefulRedisCluste
return new StatefulRedisClusterConnectionImpl(channelWriter, pushHandler, codec, timeout, parser);
}
+ /**
+ * Create a new instance of {@link StatefulRedisClusterConnectionImpl} or a subclass.
+ *
+ * Subclasses of {@link RedisClusterClient} may override that method.
+ *
+ * @param channelWriter the channel writer
+ * @param pushHandler the handler for push notifications
+ * @param codec codec
+ * @param timeout default timeout
+ * @param Key-Type
+ * @param Value Type
+ * @return new instance of StatefulRedisClusterConnectionImpl
+ */
+ protected StatefulRedisClusterConnectionImpl newStatefulRedisClusterConnection(
+ RedisChannelWriter channelWriter, ClusterPushHandler pushHandler, RedisCodec codec, Duration timeout) {
+ return new StatefulRedisClusterConnectionImpl(channelWriter, pushHandler, codec, timeout);
+ }
+
private Mono connect(Mono socketAddressSupplier, DefaultEndpoint endpoint,
StatefulRedisClusterConnectionImpl connection, Supplier commandHandlerSupplier) {