Skip to content

Commit c1d311c

Browse files
Revert version bump, move notes to Unreleased, focus tests.
- Do not bump version.rb in the PR. - Move the release note under ## Unreleased. - Trim the non-blocking fiber tests to a focused set. Assisted-By: devx/5f4cfab6-1d74-4100-8755-82d7c62c70ab
1 parent a82c28a commit c1d311c

3 files changed

Lines changed: 2 additions & 37 deletions

File tree

lib/async/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
# @namespace
77
module Async
8-
VERSION = "2.42.0"
8+
VERSION = "2.41.0"
99
end

releases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Releases
22

3-
## v2.42.0
3+
## Unreleased
44

55
- `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.
66

test/kernel/sync.rb

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@
4646

4747
with "a non-blocking fiber" do
4848
it "can run the scheduler on a non-blocking fiber" do
49-
executed = false
50-
51-
Fiber.new do
52-
Sync do |task|
53-
executed = true
54-
end
55-
end.resume
56-
57-
expect(executed).to be == true
58-
end
59-
60-
it "returns the result of the block" do
6149
result = Fiber.new do
6250
Sync {|task| value}
6351
end.resume
@@ -94,29 +82,6 @@
9482
end.to raise_exception(StandardError, message: be =~ /boom/)
9583
end
9684

97-
it "runs on the calling fiber, preserving fiber storage" do
98-
Fiber[:annotation] = "outer"
99-
100-
result = Fiber.new do
101-
Sync {|task| Fiber[:annotation]}
102-
end.resume
103-
104-
expect(result).to be == "outer"
105-
end
106-
107-
it "supports nested synchronous tasks" do
108-
result = Fiber.new do
109-
Sync do |outer|
110-
Sync do |inner|
111-
expect(inner).to be_equal(outer)
112-
value
113-
end
114-
end
115-
end.resume
116-
117-
expect(result).to be == value
118-
end
119-
12085
it "can be used from within an Enumerator" do
12186
# The value is yielded *after* `Sync` returns, so the yield happens on the enumerator fiber:
12287
enumerator = Enumerator.new do |yielder|

0 commit comments

Comments
 (0)