async 2.13.0 → 2.14.0

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: fe1866e547e6705255fdce380d3e5532964d0b74c009579f481f3c3fb8086b6c
4
- data.tar.gz: 5d3ac4bbbb8579cbcc85944c447dcea2e6b4b2408af9ad3829eace9934067199
3
+ metadata.gz: 7074249673c5f7127018a3c609ed127c962c748090959f59a2c3306bf7972a52
4
+ data.tar.gz: f3c1149ee1e5483d62a4b19ebb6c6a52fe66b0b27151685f0d939b02727c5768
5
5
  SHA512:
6
- metadata.gz: e208dc1b43979431fe3bf36acdcbebb97306bf32ec8471ea9081763d737865e47486dc798d5704ed829b27b16385f48425c4af687eda169f94e36f1c32c8ec86
7
- data.tar.gz: d961dafc64289d00b1e99b3245577d5e549365d415e6628cba39af4a5b0d58fc15da468d880fa1796c97351ff83ba2814d073ebbab18aaeaef6a3eb50be26efb
6
+ metadata.gz: 2ea1c73288b49d8f6f5eaeae711b8dc56cd93758dedca4711c52d8caea940eeaaccf423307a3633d7ae2c2317111a1120a143e88ebe15ed57063ec489973214f
7
+ data.tar.gz: a2f2d68e6fac9168d91401f907f633f99a6a4f9e323007f72d5bfa6884f1e3b30968ee8bc8a7602c36351c0f3d3b7f28ab922297c41e92a56cd8cd9009956991
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/task.rb CHANGED
@@ -354,19 +354,14 @@ module Async
354
354
  @status = :completed
355
355
  end
356
356
 
357
- # This is a very tricky aspect of tasks to get right. I've modelled it after `Thread` but it's slightly different in that the exception can propagate back up through the reactor. If the user writes code which raises an exception, that exception should always be visible, i.e. cause a failure. If it's not visible, such code fails silently and can be very difficult to debug.
358
- def failed!(exception = false, propagate = true)
357
+ # State transition into the failed state.
358
+ def failed!(exception = false)
359
359
  @result = exception
360
360
  @status = :failed
361
361
 
362
- if exception
363
- if propagate
364
- raise exception
365
- elsif @finished.nil?
366
- # If no one has called wait, we log this as a warning:
367
- Console::Event::Failure.for(exception).emit(self, "Task may have ended with unhandled exception.", severity: :warn)
368
- else
369
- Console::Event::Failure.for(exception).emit(self, severity: :debug)
362
+ if $DEBUG
363
+ Fiber.blocking do
364
+ $stderr.puts "Task #{self} failed:", exception.full_message
370
365
  end
371
366
  end
372
367
  end
@@ -407,9 +402,12 @@ module Async
407
402
  rescue Stop
408
403
  stopped!
409
404
  rescue StandardError => error
410
- failed!(error, false)
405
+ failed!(error)
411
406
  rescue Exception => exception
412
- failed!(exception, true)
407
+ failed!(exception)
408
+
409
+ # This is a critical failure, we should stop the reactor:
410
+ raise
413
411
  ensure
414
412
  # Console.info(self) {"Task ensure $! = #{$!} with #{@children&.size.inspect} children!"}
415
413
  finish!
data/lib/async/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Async
7
- VERSION = "2.13.0"
7
+ VERSION = "2.14.0"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -62,7 +62,7 @@ cert_chain:
62
62
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
63
63
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
64
64
  -----END CERTIFICATE-----
65
- date: 2024-07-12 00:00:00.000000000 Z
65
+ date: 2024-07-14 00:00:00.000000000 Z
66
66
  dependencies:
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: console
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirements: []
175
- rubygems_version: 3.5.9
175
+ rubygems_version: 3.5.11
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: A concurrency framework for Ruby.
metadata.gz.sig CHANGED
Binary file