redis-cluster-client 0.13.3 → 0.13.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2879675038f9d7ac3f0857f89fef3929453ae927877cc220f7f488535bbbe8ba
|
4
|
+
data.tar.gz: 56cbc27612c379f097066e600189aceaa7b9d62b7e0690ffda9b0392e17b0916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd73c96b5e0fcd5ae239ed8b487c8fa8118eeea9c671a1bf056feaa5832d0ff79230fc23245a319fd1af957d60472c3f891da64f840401b35576f441ded5e90e
|
7
|
+
data.tar.gz: f17a9bc4c394ae9c691030f55774397fbb22d3008cdb0784003864275cb4184b3a73097d57c396715348fbdfe9d76a44a181395020afa5920540ffaa60cb6328
|
@@ -12,6 +12,7 @@ class RedisClient
|
|
12
12
|
end
|
13
13
|
|
14
14
|
ERR_ARG_NORMALIZATION = ->(arg) { Array[arg].flatten.reject { |e| e.nil? || (e.respond_to?(:empty?) && e.empty?) } }
|
15
|
+
Ractor.make_shareable(ERR_ARG_NORMALIZATION) if Object.const_defined?(:Ractor, false) && Ractor.respond_to?(:make_shareable)
|
15
16
|
|
16
17
|
private_constant :ERR_ARG_NORMALIZATION
|
17
18
|
|
@@ -17,9 +17,19 @@ class RedisClient
|
|
17
17
|
class Router
|
18
18
|
ZERO_CURSOR_FOR_SCAN = '0'
|
19
19
|
TSF = ->(f, x) { f.nil? ? x : f.call(x) }.curry
|
20
|
+
Ractor.make_shareable(TSF) if Object.const_defined?(:Ractor, false) && Ractor.respond_to?(:make_shareable)
|
20
21
|
DEDICATED_ACTIONS = lambda do # rubocop:disable Metrics/BlockLength
|
21
22
|
action = Struct.new('RedisCommandRoutingAction', :method_name, :reply_transformer, keyword_init: true)
|
22
23
|
pick_first = ->(reply) { reply.first } # rubocop:disable Style/SymbolProc
|
24
|
+
flatten_strings = ->(reply) { reply.flatten.sort_by(&:to_s) }
|
25
|
+
sum_num = ->(reply) { reply.select { |e| e.is_a?(Integer) }.sum }
|
26
|
+
sort_numbers = ->(reply) { reply.sort_by(&:to_i) }
|
27
|
+
if Object.const_defined?(:Ractor, false) && Ractor.respond_to?(:make_shareable)
|
28
|
+
Ractor.make_shareable(pick_first)
|
29
|
+
Ractor.make_shareable(flatten_strings)
|
30
|
+
Ractor.make_shareable(sum_num)
|
31
|
+
Ractor.make_shareable(sort_numbers)
|
32
|
+
end
|
23
33
|
multiple_key_action = action.new(method_name: :send_multiple_keys_command)
|
24
34
|
all_node_first_action = action.new(method_name: :send_command_to_all_nodes, reply_transformer: pick_first)
|
25
35
|
primary_first_action = action.new(method_name: :send_command_to_primaries, reply_transformer: pick_first)
|
@@ -28,10 +38,10 @@ class RedisClient
|
|
28
38
|
{
|
29
39
|
'ping' => action.new(method_name: :send_ping_command, reply_transformer: pick_first),
|
30
40
|
'wait' => action.new(method_name: :send_wait_command),
|
31
|
-
'keys' => action.new(method_name: :send_command_to_replicas, reply_transformer:
|
32
|
-
'dbsize' => action.new(method_name: :send_command_to_replicas, reply_transformer:
|
41
|
+
'keys' => action.new(method_name: :send_command_to_replicas, reply_transformer: flatten_strings),
|
42
|
+
'dbsize' => action.new(method_name: :send_command_to_replicas, reply_transformer: sum_num),
|
33
43
|
'scan' => action.new(method_name: :send_scan_command),
|
34
|
-
'lastsave' => action.new(method_name: :send_command_to_all_nodes, reply_transformer:
|
44
|
+
'lastsave' => action.new(method_name: :send_command_to_all_nodes, reply_transformer: sort_numbers),
|
35
45
|
'role' => action.new(method_name: :send_command_to_all_nodes),
|
36
46
|
'config' => action.new(method_name: :send_config_command),
|
37
47
|
'client' => action.new(method_name: :send_client_command),
|
@@ -59,8 +69,8 @@ class RedisClient
|
|
59
69
|
'multi' => keyless_action,
|
60
70
|
'unwatch' => keyless_action
|
61
71
|
}.each_with_object({}) do |(k, v), acc|
|
62
|
-
acc[k] = v
|
63
|
-
acc[k.upcase] = v
|
72
|
+
acc[k] = v.freeze
|
73
|
+
acc[k.upcase] = v.freeze
|
64
74
|
end
|
65
75
|
end.call.freeze
|
66
76
|
|
@@ -14,7 +14,9 @@ class RedisClient
|
|
14
14
|
DEFAULT_PORT = 6379
|
15
15
|
DEFAULT_SCHEME = 'redis'
|
16
16
|
SECURE_SCHEME = 'rediss'
|
17
|
-
|
17
|
+
DEFAULT_NODE = "#{DEFAULT_SCHEME}://#{DEFAULT_HOST}:#{DEFAULT_PORT}"
|
18
|
+
Ractor.make_shareable(DEFAULT_NODE) if Object.const_defined?(:Ractor, false) && Ractor.respond_to?(:make_shareable)
|
19
|
+
DEFAULT_NODES = [DEFAULT_NODE].freeze
|
18
20
|
VALID_SCHEMES = [DEFAULT_SCHEME, SECURE_SCHEME].freeze
|
19
21
|
VALID_NODES_KEYS = %i[ssl username password host port db].freeze
|
20
22
|
MERGE_CONFIG_KEYS = %i[ssl username password].freeze
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-cluster-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taishi Kasuga
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: redis-client
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '0.
|
18
|
+
version: '0.24'
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '0.
|
25
|
+
version: '0.24'
|
26
26
|
email:
|
27
27
|
- proxy0721@gmail.com
|
28
28
|
executables: []
|