asynchronic 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asynchronic.rb +1 -0
- data/lib/asynchronic/data_store/redis.rb +1 -2
- data/lib/asynchronic/process.rb +5 -4
- data/lib/asynchronic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 208fbdbb4ecc99c379e02e453f014693f0aa9b4e
|
4
|
+
data.tar.gz: d274c2fa79f7a1fafdff2de097f08dedde801c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc97dd65da5af0027afac0ac88623f1dbd4a12d9ec6823b1bf58c819ba6e8a53c30cd1502a59c19a64dcde64b72daca4d3db67c6c95d60f3ba52bc73fa0f9c3f
|
7
|
+
data.tar.gz: 6acd4d9faaabce8023b28b5b5b75228cbe4867259966fa06358e0e75bf77d8027d993e5192b2d5c5c3a4b265a8770827709a15225161228c8db5a208b2a7bdac
|
data/lib/asynchronic.rb
CHANGED
@@ -19,6 +19,7 @@ module Asynchronic
|
|
19
19
|
attr_config :logger, Logger.new($stdout)
|
20
20
|
attr_config :retry_timeout, 30
|
21
21
|
attr_config :garbage_collector_timeout, 30
|
22
|
+
attr_config :redis_data_store_sync_timeout, 0.01
|
22
23
|
|
23
24
|
def self.environment
|
24
25
|
Environment.new queue_engine, data_store
|
@@ -2,7 +2,6 @@ module Asynchronic
|
|
2
2
|
module DataStore
|
3
3
|
class Redis
|
4
4
|
|
5
|
-
TIMEOUT = 0.001
|
6
5
|
LOCKED = 'locked'
|
7
6
|
|
8
7
|
include Helper
|
@@ -39,7 +38,7 @@ module Asynchronic
|
|
39
38
|
|
40
39
|
def synchronize(key)
|
41
40
|
while @connection.getset(@scope[key][LOCKED], LOCKED) == LOCKED
|
42
|
-
sleep
|
41
|
+
sleep Asynchronic.redis_data_store_sync_timeout
|
43
42
|
end
|
44
43
|
yield
|
45
44
|
ensure
|
data/lib/asynchronic/process.rb
CHANGED
@@ -210,14 +210,15 @@ module Asynchronic
|
|
210
210
|
|
211
211
|
def wakeup_children
|
212
212
|
if waiting?
|
213
|
-
|
214
|
-
|
213
|
+
children = processes # Cached child processes
|
214
|
+
if children.any?(&:aborted?)
|
215
|
+
childs_with_errors = children.select(&:error)
|
215
216
|
error = childs_with_errors.any? ? "Error caused by #{childs_with_errors.map(&:name).join(', ')}" : nil
|
216
217
|
abort! error
|
217
|
-
elsif
|
218
|
+
elsif children.all?(&:completed?)
|
218
219
|
completed!
|
219
220
|
else
|
220
|
-
|
221
|
+
children.each do |p|
|
221
222
|
p.enqueue if p.ready?
|
222
223
|
end
|
223
224
|
end
|
data/lib/asynchronic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asynchronic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|