redis-cluster-client 0.3.10 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e617645bfcf37192c1c665ceaee819439ee26821688906d311dd3792fc6c7d5
4
- data.tar.gz: c9a3125c8d012dfc937464aa37751c26e35fa8a7696a3b418a87f7019b263a06
3
+ metadata.gz: '0890e2d621a219037cad3f57ff1f3ea459f274ae1027247360a644743b323e0c'
4
+ data.tar.gz: 7225a3ba1fa71776c81deda0ff34aa4fc46eb0146aa63da8b9c3b5d9503a807f
5
5
  SHA512:
6
- metadata.gz: b2a815abb356acc39f0e842b5ecef6dd3d997b7554db351f7804289d386d8178221cab843e2144affceb55e849e52c672a99c49e51ef12d54000d0ee2b754f91
7
- data.tar.gz: f19f384f8928b1487d45fb7171b4af70becc6b34a5da9a7e9dc15050d88035123f9b8e08c979c01a59fce6581337a9155d4ba1a221397a4948b1aeadceee5957
6
+ metadata.gz: 78d7cb40b48dae677dea264d7408546673414f927edd236ae5d091ba09fabc306465ffb3b2c77c39c475886d1e547f7f630ee112f193fceb4d39df4a6b94c75f
7
+ data.tar.gz: 8990869249f008c27c7a795c6d73cd6b7d942eecce4ba0d9dd1d85b4b9ba65048f367b155be24cc8d8c90c4095fe67c1aa5133120504a433cd43f2b715802384
@@ -8,6 +8,8 @@ class RedisClient
8
8
  class Cluster
9
9
  class Command
10
10
  EMPTY_STRING = ''
11
+ LEFT_BRACKET = '{'
12
+ RIGHT_BRACKET = '}'
11
13
 
12
14
  Detail = Struct.new(
13
15
  'RedisCommand',
@@ -104,10 +106,11 @@ class RedisClient
104
106
  # @see https://redis.io/topics/cluster-spec#keys-hash-tags Keys hash tags
105
107
  def extract_hash_tag(key)
106
108
  key = key.to_s
107
- s = key.index('{')
108
- e = key.index('}', s.to_i + 1)
109
+ s = key.index(LEFT_BRACKET)
110
+ return EMPTY_STRING if s.nil?
109
111
 
110
- return EMPTY_STRING if s.nil? || e.nil?
112
+ e = key.index(RIGHT_BRACKET, s + 1)
113
+ return EMPTY_STRING if e.nil?
111
114
 
112
115
  key[s + 1..e - 1]
113
116
  end
@@ -43,7 +43,6 @@ class RedisClient
43
43
  clients.each_slice(::RedisClient::Cluster::Node::MAX_THREADS).each_with_object({}) do |chuncked_clients, acc|
44
44
  threads = chuncked_clients.map do |k, v|
45
45
  Thread.new(k, v) do |node_key, client|
46
- Thread.pass
47
46
  Thread.current.thread_variable_set(:node_key, node_key)
48
47
 
49
48
  min = DUMMY_LATENCY_NSEC
@@ -85,7 +85,6 @@ class RedisClient
85
85
  startup_nodes.each_slice(MAX_THREADS).with_index do |chuncked_startup_nodes, chuncked_idx|
86
86
  threads = chuncked_startup_nodes.each_with_index.map do |raw_client, idx|
87
87
  Thread.new(raw_client, (MAX_THREADS * chuncked_idx) + idx) do |cli, i|
88
- Thread.pass
89
88
  Thread.current.thread_variable_set(:index, i)
90
89
  reply = cli.call('CLUSTER', 'NODES')
91
90
  Thread.current.thread_variable_set(:info, parse_cluster_node_reply(reply))
@@ -304,7 +303,6 @@ class RedisClient
304
303
  clients.each_slice(MAX_THREADS) do |chuncked_clients|
305
304
  threads = chuncked_clients.map do |k, v|
306
305
  Thread.new(k, v) do |node_key, client|
307
- Thread.pass
308
306
  Thread.current.thread_variable_set(:node_key, node_key)
309
307
  reply = yield(node_key, client)
310
308
  Thread.current.thread_variable_set(:result, reply)
@@ -142,7 +142,6 @@ class RedisClient
142
142
  @pipelines&.each_slice(MAX_THREADS) do |chuncked_pipelines|
143
143
  threads = chuncked_pipelines.map do |node_key, pipeline|
144
144
  Thread.new(node_key, pipeline) do |nk, pl|
145
- Thread.pass
146
145
  Thread.current.thread_variable_set(:node_key, nk)
147
146
  replies = do_pipelining(@router.find_node(nk), pl)
148
147
  raise ReplySizeError, "commands: #{pl._size}, replies: #{replies.size}" if pl._size != replies.size
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-25 00:00:00.000000000 Z
11
+ date: 2022-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.3.15
72
+ rubygems_version: 3.3.22
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: A Redis cluster client for Ruby