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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 434f1d892b6acee168dbbde217a37879fdbf203e4a64bd3dd4ab49fee1feef44
4
- data.tar.gz: 0e8fa621829f5f77c7d96d22c4f753b81668ee32e291c34ebf09d97d11f9ec2a
3
+ metadata.gz: 7e998dd042f7fc4c496862c3ca2feec5f370ac86c803dcc61c55d970f6bae28a
4
+ data.tar.gz: fcd146663d144d9ccf9738c58594faabda6b98cf754523b1145b65016715eac7
5
5
  SHA512:
6
- metadata.gz: 1f96eedf368fca4bf9fe1b86f6c4b2d312f8b8f40a09dac2a3b2b905b250272a84d77f79cd0e2eb4f2cc1ef87eea67366f114722ed7907c187f77586af44a640
7
- data.tar.gz: 61d05af06a151b19a7a01013efee71ee251a8f011732e904f7f6485438c5cbb86341e27106190ba2e516005342854e564f19d8248cc7928749cedcd4a543f0eb
6
+ metadata.gz: 6315fe469b3e53cdfb87cd569e4833eb34669ab961d3a16fd1c435b5490dd52087ebfe55b8fea41ea997759918d695ab1f999effecd43cf73419cbd5a60d3a47
7
+ data.tar.gz: 720846506b9f600528c7c1ada372741abd42bd2588ab2c4f9e0ec53ea7e19877b08b9bac37b103345092e9fcf67a493c2714149c06e5211f7257c609657385f2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- async-tools (0.1.9)
4
+ async-tools (0.1.10)
5
5
  async (~> 2.3)
6
6
  zeitwerk (~> 2.6)
7
7
 
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
- call if @run_on_start || run
47
+ rescued_call if @run_on_start || run
48
48
 
49
49
  loop do
50
50
  sleep(@delay)
51
- call
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Async # rubocop:disable Style/ClassAndModuleChildren
4
4
  module Tools
5
- VERSION = "0.1.9"
5
+ VERSION = "0.1.10"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Sinyavskiy