async 2.41.0 → 2.42.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: c707fb6001b639a32c63b2eac330cde48e8d411dc766fca44b98816991f4daea
4
- data.tar.gz: cff7be5da559c06c9d040717057270d9e2369f26b9ac481fa56e92d8383103b5
3
+ metadata.gz: f4b0d66ab9efdfe8910e6eced080524be096c8f6b82b2d2fb5477f00bdb0a6da
4
+ data.tar.gz: a35b33bdb575b1c097ccc2fffc3d49eac0ae36054f8bb750d342c21c866961f2
5
5
  SHA512:
6
- metadata.gz: 8ff5660626ce3c460bfe1b5796185a3421c5b060da99624a0fcf8943e2a634c5c5f1919ca281d29debaf04687ed5be6b7f70c36cf63a12bd96a776a06ec7e3ac
7
- data.tar.gz: c5d0a80e1f6795afabd7b0ae1f5dda8d3d9f5083be0cbb2b5cb121977e389b68c71ef87e875d521bed65080652be5e5843061f32247a6bab35ef20e1d06e5484
6
+ metadata.gz: 926c49c93ba5541ee1d3ca5ee3b70024da00f77c71aaf388d604e167f09f664f6e49dc17647ec47ba395f1e9970d36d3e251cc544304caaa2ce37f25617b61f2
7
+ data.tar.gz: 2a07815c98380ec7fce0d4a262b5b06756d9379eb72d35edf8a46b06cc7fa34fa01ae81ff2aaba99731d75ba0bbd7deafc41744b27fce4d5e67d4d03e5c90c2e
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
 
6
6
  # @namespace
7
7
  module Async
8
- VERSION = "2.41.0"
8
+ VERSION = "2.42.0"
9
9
  end
data/lib/kernel/async.rb CHANGED
@@ -27,13 +27,15 @@ module Kernel
27
27
  elsif scheduler = Fiber.scheduler
28
28
  ::Async::Task.run(scheduler, ...)
29
29
  else
30
- # This calls Fiber.set_scheduler(self):
31
- reactor = ::Async::Reactor.new
32
-
33
- begin
34
- return reactor.run(...)
35
- ensure
36
- Fiber.set_scheduler(nil)
30
+ Fiber.blocking do
31
+ # This calls Fiber.set_scheduler(self):
32
+ reactor = ::Async::Reactor.new
33
+
34
+ begin
35
+ return reactor.run(...)
36
+ ensure
37
+ Fiber.set_scheduler(nil)
38
+ end
37
39
  end
38
40
  end
39
41
  end
data/lib/kernel/sync.rb CHANGED
@@ -27,15 +27,16 @@ module Kernel
27
27
  elsif scheduler = Fiber.scheduler
28
28
  ::Async::Task.run(scheduler, &block).wait
29
29
  else
30
- # This calls Fiber.set_scheduler(self):
31
- reactor = Async::Reactor.new
32
-
33
- begin
34
- # Use finished: false to suppress warnings since we're handling exceptions explicitly
35
- task = reactor.run(annotation: annotation, finished: false, &block)
36
- return task.wait
37
- ensure
38
- Fiber.set_scheduler(nil)
30
+ Fiber.blocking do
31
+ # This calls Fiber.set_scheduler(self):
32
+ reactor = Async::Reactor.new
33
+
34
+ begin
35
+ # Use finished: false to suppress warnings since we're handling exceptions explicitly
36
+ return reactor.run(annotation: annotation, finished: false, &block).wait
37
+ ensure
38
+ Fiber.set_scheduler(nil)
39
+ end
39
40
  end
40
41
  end
41
42
  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.42.0
39
+
40
+ - `Sync` and `Async` can now be invoked from a non-blocking fiber that has no scheduler (e.g. inside an `Enumerator` or a bare `Fiber.new`). Previously this raised `RuntimeError: Running scheduler on non-blocking fiber!`. The reactor is now run within `Fiber.blocking`, so the scheduler always runs on a blocking fiber.
41
+
38
42
  ### v2.41.0
39
43
 
40
44
  - **Fixed**: Protect initial task from Interrupt exceptions.
@@ -75,10 +79,6 @@ Please see the [project releases](https://socketry.github.io/async/releases/inde
75
79
  - Improved handling of `Process.fork` on Ruby 4+.
76
80
  - Improve `@promise` state handling in `Task#initialize`, preventing incomplete instances being visible to the scheduler.
77
81
 
78
- ### v2.35.1
79
-
80
- - Fix incorrect handling of spurious wakeups in `Async::Promise#wait`, which could lead to premature (incorrect) resolution of the promise.
81
-
82
82
  ## See Also
83
83
 
84
84
  - [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.42.0
4
+
5
+ - `Sync` and `Async` can now be invoked from a non-blocking fiber that has no scheduler (e.g. inside an `Enumerator` or a bare `Fiber.new`). Previously this raised `RuntimeError: Running scheduler on non-blocking fiber!`. The reactor is now run within `Fiber.blocking`, so the scheduler always runs on a blocking fiber.
6
+
3
7
  ## v2.41.0
4
8
 
5
9
  - **Fixed**: Protect initial task from Interrupt exceptions.
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.41.0
4
+ version: 2.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file