Skip to content

Commit 094a8e9

Browse files
committed
Release notes.
1 parent 9ea3b22 commit 094a8e9

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

releases.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ The `Async::WorkerPool` implementation has been removed in favor of using `IO::E
88

99
To enable the worker pool, you can set the `ASYNC_SCHEDULER_WORKER_POOL` environment variable to `true`. This will allow the scheduler to use a worker pool for blocking operations, which can help improve performance in applications that perform a lot of CPU-bound operations (e.g. `rb_nogvl`).
1010

11+
### Better handling of `IO#close` using `fiber_interrupt`
12+
13+
`IO#close` interrupts fibers that are waiting on the IO using the new `fiber_interrupt` hook introduced in Ruby 3.5/4.0. This means that if you close an IO while a fiber is waiting on it, the fiber will be interrupted and will raise an `IOError`. This is a change from previous versions of Ruby, where closing an IO would not interrupt fibers waiting on it, and would instead interrupt the entire event loop (essentially a bug).
14+
15+
```ruby
16+
r, w = IO.pipe
17+
18+
Async do
19+
child = Async do
20+
r.gets
21+
end
22+
23+
r.close # This will interrupt the child fiber.
24+
child.wait # This will raise an `IOError` because the IO was closed.
25+
end
26+
```
27+
1128
## v2.24.0
1229

1330
- Ruby v3.1 support is dropped.

0 commit comments

Comments
 (0)