async 2.45.1 → 2.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f51489757a93062c6aa4ccf5ad1f3c7367c4a374166dc704d42168f13f539c86
4
- data.tar.gz: 056c11094c9ea4bffc8c5b808a50a3af4bc699b24497cd3f9c8ea3afe3745cfb
3
+ metadata.gz: 18ce3669315568ddd2a3318bf2b0ab7bdee50c4fe2e902a706c06d81a408eaf8
4
+ data.tar.gz: c29f7d729d77e461520d10016ae4a54d9381fdf2c6d6abfa3c0f46552f1534d4
5
5
  SHA512:
6
- metadata.gz: 62c77f5b6dbb84291d2435e0098965d6d78b6dd906f8fd538adb5139240f18dc50484c89b0b7f0772aa0ad85139d3c31a38cbe36425d38f21dec7a310d22cae2
7
- data.tar.gz: 5e356c8c7754bccece84388bb95ed6f9860924279d5f084673b62c6d0a1b549bdabb19e47b0b05748444b2f43e37d21addf70ed01b39aa5f994531b7676b4648
6
+ metadata.gz: 1cbe34605af8123fa6f793053e27fa812a7b0709e9e4e5a4a7cc94a5d7331ca7b5f4179f794a30b0c73beafde19cea01ef767d5703e9993103a6ee41d89c09c2
7
+ data.tar.gz: aa02831263ecc1476e8d4f36ee39177b74a6c3ef5f6d823a5e5346ae5c9747c357e6cf37a588d1348a1f553d3d97a6d65ccb51f8454e001d5f5278aa0981a458
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/task.rb CHANGED
@@ -327,6 +327,11 @@ module Async
327
327
  # @parameter later [Boolean] Whether to cancel the task later, or immediately.
328
328
  # @parameter cause [Exception] The cause of the cancel operation.
329
329
  def cancel(later = false, cause: $!)
330
+ # On affected Ruby versions, `Thread#kill` exposes the internal `TAG_FATAL` value through `$!`, which is not a valid exception cause:
331
+ unless cause.is_a?(::Exception)
332
+ cause = nil
333
+ end
334
+
330
335
  # If no cause is given, we generate one from the current call stack:
331
336
  unless cause
332
337
  cause = Cancel::Cause.for("Cancelling task!")
data/lib/async/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
 
6
6
  # @namespace
7
7
  module Async
8
- VERSION = "2.45.1"
8
+ VERSION = "2.46.0"
9
9
  end
data/readme.md CHANGED
@@ -35,6 +35,10 @@ Please see the [project documentation](https://socketry.github.io/async/) for mo
35
35
 
36
36
  Please see the [project releases](https://socketry.github.io/async/releases/index) for all releases.
37
37
 
38
+ ### v2.46.0
39
+
40
+ - Fixed `Thread#kill` raising a `TypeError` while shutting down a thread with an active `Async::Reactor`.
41
+
38
42
  ### v2.45.1
39
43
 
40
44
  - Fixed `Scheduler#io_wait` returning `nil` instead of `false` when an explicit timeout expired. Native callers such as `Socket#connect` with `connect_timeout:` distinguish a timeout by checking for `false`, so the `nil` caused `TypeError: no implicit conversion from nil to integer` instead of the intended `IO::TimeoutError`.
@@ -71,11 +75,6 @@ Please see the [project releases](https://socketry.github.io/async/releases/inde
71
75
 
72
76
  - Fix `Barrier#async` when `parent.async` yields before the child block executes. Previously, `Barrier#wait` could return early and miss tracking the task entirely, because the task had not yet appended itself to the barrier's task list.
73
77
 
74
- ### v2.38.0
75
-
76
- - Rename `Task#stop` to `Task#cancel` for better clarity and consistency with common concurrency terminology. The old `stop` method is still available as an alias for backward compatibility, but it is recommended to use `cancel` going forward.
77
- - Forward arguments from `Task#wait` -\> `Promise#wait`, so `task.wait(timeout: N)` is supported.
78
-
79
78
  ## See Also
80
79
 
81
80
  - [async-http](https://github.com/socketry/async-http) — Asynchronous HTTP client/server.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v2.46.0
4
+
5
+ - Fixed `Thread#kill` raising a `TypeError` while shutting down a thread with an active `Async::Reactor`.
6
+
3
7
  ## v2.45.1
4
8
 
5
9
  - Fixed `Scheduler#io_wait` returning `nil` instead of `false` when an explicit timeout expired. Native callers such as `Socket#connect` with `connect_timeout:` distinguish a timeout by checking for `false`, so the `nil` caused `TypeError: no implicit conversion from nil to integer` instead of the intended `IO::TimeoutError`.
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.45.1
4
+ version: 2.46.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file