redis-cluster-client 0.17.0 → 0.17.1
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 +4 -4
- data/lib/redis_client/cluster/pipeline.rb +18 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5dbfbaf304e900620662da7b8b5e6af36dfda8dc62a27d3e9a1efb975f5bd07f
|
|
4
|
+
data.tar.gz: 8080422513db9f7edcbad4d3eafc4fb0472d5a754ee2a0bc64eaacfda8e283e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 980a40227b929c64632ff903ad4334942489d3c2af13ef0ec09006be856ae7c06a2e96c1a4c8c9a976b38091f53aa2e87833a5d6d04c07a0426129da20924838
|
|
7
|
+
data.tar.gz: b7915e5337c66a3a0423ebcb206e7be0b3794ce1ccac40a1a99e08b8f305a594c9594d6a670f3679d1df081e80527fde4a153ac6949c7ca832bbb149fc0dcfee
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'set'
|
|
3
4
|
require 'redis_client'
|
|
4
5
|
require 'redis_client/cluster/errors'
|
|
5
6
|
require 'redis_client/cluster/noop_command_builder'
|
|
@@ -44,6 +45,19 @@ class RedisClient
|
|
|
44
45
|
def get_block(inner_index)
|
|
45
46
|
@blocks.is_a?(Array) ? @blocks[inner_index] : nil
|
|
46
47
|
end
|
|
48
|
+
|
|
49
|
+
def coerce_except!(replies, indices)
|
|
50
|
+
return replies unless @blocks.is_a?(Array)
|
|
51
|
+
|
|
52
|
+
skipped = Set.new(indices)
|
|
53
|
+
@blocks.each_with_index do |block, index|
|
|
54
|
+
next if block.nil? || skipped.include?(index)
|
|
55
|
+
|
|
56
|
+
replies[index] = block.call(replies[index])
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
replies
|
|
60
|
+
end
|
|
47
61
|
end
|
|
48
62
|
|
|
49
63
|
::RedisClient::ConnectionMixin.module_eval do
|
|
@@ -209,6 +223,7 @@ class RedisClient
|
|
|
209
223
|
|
|
210
224
|
all_replies ||= Array.new(@size)
|
|
211
225
|
pipeline = @pipelines[node_key]
|
|
226
|
+
pipeline.coerce_except!(v.replies, v.indices)
|
|
212
227
|
v.indices.each { |i| v.replies[i] = handle_redirection(v.replies[i], pipeline, i) }
|
|
213
228
|
pipeline.outer_indices.each_with_index { |outer, inner| all_replies[outer] = v.replies[inner] }
|
|
214
229
|
end
|
|
@@ -217,7 +232,9 @@ class RedisClient
|
|
|
217
232
|
raise v.first_exception if v.first_exception
|
|
218
233
|
|
|
219
234
|
all_replies ||= Array.new(@size)
|
|
220
|
-
@pipelines[node_key]
|
|
235
|
+
pipeline = @pipelines[node_key]
|
|
236
|
+
pipeline._coerce!(v.replies)
|
|
237
|
+
pipeline.outer_indices.each_with_index { |outer, inner| all_replies[outer] = v.replies[inner] }
|
|
221
238
|
end
|
|
222
239
|
|
|
223
240
|
all_replies
|