redis-cluster-client 0.17.1 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dbfbaf304e900620662da7b8b5e6af36dfda8dc62a27d3e9a1efb975f5bd07f
4
- data.tar.gz: 8080422513db9f7edcbad4d3eafc4fb0472d5a754ee2a0bc64eaacfda8e283e0
3
+ metadata.gz: 359726530c2640f2ceb9c6c06322c4608fec64338c33d3b29f675b1e152c6700
4
+ data.tar.gz: ec32116a8cde689a6ea78cc029159174404288c63b452d797ff3646669b5141e
5
5
  SHA512:
6
- metadata.gz: 980a40227b929c64632ff903ad4334942489d3c2af13ef0ec09006be856ae7c06a2e96c1a4c8c9a976b38091f53aa2e87833a5d6d04c07a0426129da20924838
7
- data.tar.gz: b7915e5337c66a3a0423ebcb206e7be0b3794ce1ccac40a1a99e08b8f305a594c9594d6a670f3679d1df081e80527fde4a153ac6949c7ca832bbb149fc0dcfee
6
+ metadata.gz: f4b810aa80374e5720533c82846ac0485682c6b8bcd5902c6a71a9b4d2c830914a3d97cfb8c378a402b3cd44cd5a96361067d461f177d8672b918a3b6911a38d
7
+ data.tar.gz: 4614bba3d265eeedf3ebe72fa75ab10ca2543a48aa0e622b530fa54ad1701af158a77819e4d0cd6aa7ce1f913df139169497caf084186eb6875a49e312b84d94
@@ -33,6 +33,7 @@ class RedisClient
33
33
  'keys' => RoutingAction.new(method_name: :send_command_to_replicas, reply_transformer: FLATTEN_STRINGS),
34
34
  'dbsize' => RoutingAction.new(method_name: :send_command_to_replicas, reply_transformer: SUM_NUM),
35
35
  'scan' => RoutingAction.new(method_name: :send_scan_command),
36
+ 'bless' => RoutingAction.new(method_name: :send_bless_command),
36
37
  'lastsave' => RoutingAction.new(method_name: :send_command_to_all_nodes, reply_transformer: SORT_NUMBERS),
37
38
  'role' => RoutingAction.new(method_name: :send_command_to_all_nodes),
38
39
  'config' => RoutingAction.new(method_name: :send_config_command),
@@ -133,9 +133,9 @@ class RedisClient
133
133
  retry
134
134
  end
135
135
 
136
- def scan(command, seed: nil) # rubocop:disable Metrics/AbcSize
137
- command[1] = ZERO_CURSOR_FOR_SCAN if command.size == 1
138
- input_cursor = Integer(command[1])
136
+ def scan(command, seed: nil, cursor_index: 1) # rubocop:disable Metrics/AbcSize
137
+ command[cursor_index] = ZERO_CURSOR_FOR_SCAN if command.size == cursor_index
138
+ input_cursor = Integer(command[cursor_index])
139
139
 
140
140
  client_index = input_cursor % 256
141
141
  raw_cursor = input_cursor >> 8
@@ -145,7 +145,7 @@ class RedisClient
145
145
  client = clients[client_index]
146
146
  return [ZERO_CURSOR_FOR_SCAN, []] unless client
147
147
 
148
- command[1] = raw_cursor.to_s
148
+ command[cursor_index] = raw_cursor.to_s
149
149
 
150
150
  result_cursor, result_keys = client.call_v(command)
151
151
  result_cursor = Integer(result_cursor)
@@ -327,6 +327,14 @@ class RedisClient
327
327
  end
328
328
  end
329
329
 
330
+ def send_bless_command(method, command, args, &block)
331
+ if command[1].casecmp('scan').zero?
332
+ scan(command, seed: 1, cursor_index: 2).then(&TSF.call(block))
333
+ else
334
+ assign_node(command).public_send(method, *args, command, &block)
335
+ end
336
+ end
337
+
330
338
  def send_memory_command(method, command, args, &block)
331
339
  if command[1].casecmp('stats').zero?
332
340
  @node.call_all(method, command, args, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 4.0.16
78
+ rubygems_version: 4.0.20
79
79
  specification_version: 4
80
80
  summary: Redis cluster-aware client for Ruby
81
81
  test_files: []