async-tools 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/async/timer.rb +8 -4
- data/lib/async/tools/version.rb +1 -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: 7e998dd042f7fc4c496862c3ca2feec5f370ac86c803dcc61c55d970f6bae28a
|
4
|
+
data.tar.gz: fcd146663d144d9ccf9738c58594faabda6b98cf754523b1145b65016715eac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6315fe469b3e53cdfb87cd569e4833eb34669ab961d3a16fd1c435b5490dd52087ebfe55b8fea41ea997759918d695ab1f999effecd43cf73419cbd5a60d3a47
|
7
|
+
data.tar.gz: 720846506b9f600528c7c1ada372741abd42bd2588ab2c4f9e0ec53ea7e19877b08b9bac37b103345092e9fcf67a493c2714149c06e5211f7257c609657385f2
|
data/Gemfile.lock
CHANGED
data/lib/async/timer.rb
CHANGED
@@ -44,17 +44,21 @@ class Async::Timer
|
|
44
44
|
@active = true
|
45
45
|
|
46
46
|
@task = @parent.async do
|
47
|
-
|
47
|
+
rescued_call if @run_on_start || run
|
48
48
|
|
49
49
|
loop do
|
50
50
|
sleep(@delay)
|
51
|
-
|
51
|
+
rescued_call
|
52
52
|
break unless @repeat
|
53
|
-
rescue StandardError => e
|
54
|
-
@on_error.call(e)
|
55
53
|
ensure
|
56
54
|
@active = false
|
57
55
|
end
|
58
56
|
end
|
59
57
|
end
|
58
|
+
|
59
|
+
def rescued_call
|
60
|
+
call
|
61
|
+
rescue StandardError => e
|
62
|
+
@on_error.call(e)
|
63
|
+
end
|
60
64
|
end
|
data/lib/async/tools/version.rb
CHANGED