redis-cluster-client 0.4.9 → 0.4.11

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: 19e03bc6e2b6ddf57697c9e63dd5ffa729e6621979b3daef02b28062dc328494
4
- data.tar.gz: f212df153cda0c53710c5f03586c01042d168380982113e4dd354ae859c276b4
3
+ metadata.gz: c6055086f0723628b8c2d7158f2b49ecf6378095bcb4c7e4123461d2c14b5ff5
4
+ data.tar.gz: db0b1fbd400b8eafed3c3f7a660824e77d3df456eb88f6cf99f4a89572989385
5
5
  SHA512:
6
- metadata.gz: e6034b7693d67eaec5e979fe5cce0c310746262971a77642392930ee1dc2be2cefcad6ac3729cc8d11fb3a2d3ba1077ee2aacfef618fc570c688850056f1c1f6
7
- data.tar.gz: 5182806018f1452094085cea4f2c1bd70ecbfe71d4d5b178fec7f06712debd4cb843fb794ab1b1d29df61204a14db9a0e92eb133f40ffcb732397dd76c7e199f
6
+ metadata.gz: 7d2a016a5e7f970ed6444721a51de7c8afa3412a27a7400ed75fa7ad9e43c9f4e308fe5992f25e7bfa863446b54ab8527d8bc425888d6c36bed7cddc702bb134
7
+ data.tar.gz: 2b885ed32758f4deecbd6449a70f484ed340a0b123e0cc920756fe06df7898c1f77af3874f2da1d062d53d478aad6033628ecec8f0754e3ec977b1ffc56a5840
@@ -22,7 +22,7 @@ class RedisClient
22
22
 
23
23
  def take_message(timeout)
24
24
  @worker = subscribe(@client, timeout) if @worker.nil?
25
- return if @worker.join(0.01).nil?
25
+ return if @worker.alive?
26
26
 
27
27
  message = @worker[:reply]
28
28
  @worker = nil
@@ -64,10 +64,12 @@ class RedisClient
64
64
 
65
65
  max_duration = calc_max_duration(timeout)
66
66
  starting = obtain_current_time
67
+ clients = @states.values
67
68
  loop do
68
69
  break if max_duration > 0 && obtain_current_time - starting > max_duration
69
70
 
70
- @states.values.shuffle.each do |pubsub|
71
+ clients.shuffle!
72
+ clients.each do |pubsub|
71
73
  message = pubsub.take_message(timeout)
72
74
  return message if message
73
75
  end
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.4.9
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-11 00:00:00.000000000 Z
11
+ date: 2023-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client