@@ -22,13 +22,14 @@ class ClusterConfig
22
22
23
23
attr_reader :command_builder
24
24
25
- def initialize ( nodes : DEFAULT_NODES , replica : false , fixed_hostname : '' , **client_config )
25
+ def initialize ( nodes : DEFAULT_NODES , replica : false , client_implementation : Cluster , fixed_hostname : '' , **client_config )
26
26
@replica = true & replica
27
27
@fixed_hostname = fixed_hostname . to_s
28
28
@node_configs = build_node_configs ( nodes . dup )
29
29
client_config = client_config . reject { |k , _ | IGNORE_GENERIC_CONFIG_KEYS . include? ( k ) }
30
30
@command_builder = client_config . fetch ( :command_builder , ::RedisClient ::CommandBuilder )
31
31
@client_config = merge_generic_config ( client_config , @node_configs )
32
+ @client_implementation = client_implementation
32
33
@mutex = Mutex . new
33
34
end
34
35
@@ -37,11 +38,11 @@ def inspect
37
38
end
38
39
39
40
def new_pool ( size : 5 , timeout : 5 , **kwargs )
40
- :: RedisClient :: Cluster . new ( self , pool : { size : size , timeout : timeout } , **kwargs )
41
+ @client_implementation . new ( self , pool : { size : size , timeout : timeout } , **kwargs )
41
42
end
42
43
43
44
def new_client ( **kwargs )
44
- :: RedisClient :: Cluster . new ( self , **kwargs )
45
+ @client_implementation . new ( self , **kwargs )
45
46
end
46
47
47
48
def per_node_key
0 commit comments