@@ -121,6 +121,7 @@ def parse_cluster_shards(resp, **options):
121
121
"charset" ,
122
122
"connection_class" ,
123
123
"connection_pool" ,
124
+ "connection_pool_class" ,
124
125
"client_name" ,
125
126
"credential_provider" ,
126
127
"db" ,
@@ -1267,6 +1268,7 @@ def __init__(
1267
1268
require_full_coverage = False ,
1268
1269
lock = None ,
1269
1270
dynamic_startup_nodes = True ,
1271
+ connection_pool_class = ConnectionPool ,
1270
1272
** kwargs ,
1271
1273
):
1272
1274
self .nodes_cache = {}
@@ -1277,6 +1279,7 @@ def __init__(
1277
1279
self .from_url = from_url
1278
1280
self ._require_full_coverage = require_full_coverage
1279
1281
self ._dynamic_startup_nodes = dynamic_startup_nodes
1282
+ self .connection_pool_class = connection_pool_class
1280
1283
self ._moved_exception = None
1281
1284
self .connection_kwargs = kwargs
1282
1285
self .read_load_balancer = LoadBalancer ()
@@ -1420,7 +1423,7 @@ def create_redis_node(self, host, port, **kwargs):
1420
1423
# Create a redis node with a costumed connection pool
1421
1424
kwargs .update ({"host" : host })
1422
1425
kwargs .update ({"port" : port })
1423
- r = Redis (connection_pool = ConnectionPool (** kwargs ))
1426
+ r = Redis (connection_pool = self . connection_pool_class (** kwargs ))
1424
1427
else :
1425
1428
r = Redis (host = host , port = port , ** kwargs )
1426
1429
return r
0 commit comments