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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/version.rb +1 -1
- data/lib/kernel/async.rb +9 -7
- data/lib/kernel/sync.rb +10 -9
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4b0d66ab9efdfe8910e6eced080524be096c8f6b82b2d2fb5477f00bdb0a6da
|
|
4
|
+
data.tar.gz: a35b33bdb575b1c097ccc2fffc3d49eac0ae36054f8bb750d342c21c866961f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 926c49c93ba5541ee1d3ca5ee3b70024da00f77c71aaf388d604e167f09f664f6e49dc17647ec47ba395f1e9970d36d3e251cc544304caaa2ce37f25617b61f2
|
|
7
|
+
data.tar.gz: 2a07815c98380ec7fce0d4a262b5b06756d9379eb72d35edf8a46b06cc7fa34fa01ae81ff2aaba99731d75ba0bbd7deafc41744b27fce4d5e67d4d03e5c90c2e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/async/version.rb
CHANGED
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
metadata.gz.sig
CHANGED
|
Binary file
|