io-event 1.16.3 → 1.16.4

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: 7823ee584acc17c23f0f464a60271449a4298733efa62623653420b9181a5201
4
- data.tar.gz: c71e15d6f35113a68bf31442621d2a4b9f8e8ca8d9b0d27dae234c30005f4ae0
3
+ metadata.gz: 83f9faed054855a0c3a50ab469f315c1345a8af43641ab6c5630d648763fc55d
4
+ data.tar.gz: 78114e047cd897ed0192c262d099a93baea21d0c30ddb70cd57e4efc73a40889
5
5
  SHA512:
6
- metadata.gz: 60764fbe8a01ce3a77d8ad796473934f41a92edf30772265d4f0abbaf89bb9b1b79e1776cd9071111e0ff2590fc9402892cbaea1e22c779f9f3fdfe5ca18b9e9
7
- data.tar.gz: 452f83f2b2a7550b6aa01f1d5094b62171e2a6179d8760651c3275397be65fb653adf12c8db1c3470d5cdcdbacf88e48dd208f01b53e2f0ed50eac91d104c06e
6
+ metadata.gz: 7cea5251f1c5b93b0235e2aa6aa69c65913e13de847a535eee21343060f744b2a810eb901b15b82bbb3c9979d60a620d4d89dfba349473ab6836e9c420985b9d
7
+ data.tar.gz: c8752f8a0bc9da0ca37ae420364a564c68ad4cb6020124f767677a854c7d81639e9e6daa46040d8fc575e02a7231ff5409d72833b8eb15ec72684b063b5d92d2
checksums.yaml.gz.sig CHANGED
Binary file
@@ -14,6 +14,8 @@ module IO::Event
14
14
  @selector = selector
15
15
  @input, @output = ::IO.pipe
16
16
 
17
+ @output.sync = true
18
+
17
19
  @fiber = Fiber.new do
18
20
  while true
19
21
  if @selector.io_wait(@fiber, @input, IO::READABLE)
@@ -27,16 +29,18 @@ module IO::Event
27
29
  @fiber.transfer
28
30
  end
29
31
 
30
- # Send a sigle byte interrupt.
32
+ # Send a single byte interrupt.
31
33
  def signal
32
- @output.write(".")
33
- @output.flush
34
- rescue IOError
35
- # Ignore.
34
+ # This must not block or enter blocking operations or raise an exception.
35
+ # Note that `Scheduler#unblock` defers exceptions, so `IOError` will not be raised by `@output.close` until later.
36
+ @output.write_nonblock(".", exception: false) rescue nil
36
37
  end
37
38
 
38
39
  def close
40
+ # In principle, this should cause the fiber to exit:
39
41
  @input.close
42
+
43
+ # This may cause `signal` to raise an exception:
40
44
  @output.close
41
45
  end
42
46
  end
@@ -7,6 +7,6 @@
7
7
  class IO
8
8
  # @namespace
9
9
  module Event
10
- VERSION = "1.16.3"
10
+ VERSION = "1.16.4"
11
11
  end
12
12
  end
data/readme.md CHANGED
@@ -18,6 +18,10 @@ Please see the [project documentation](https://socketry.github.io/io-event/) for
18
18
 
19
19
  Please see the [project releases](https://socketry.github.io/io-event/releases/index) for all releases.
20
20
 
21
+ ### v1.16.4
22
+
23
+ - Correctly implement `Interrupt#signal` so that it is robust enough to be called by `Scheduler#unblock`.
24
+
21
25
  ### v1.16.3
22
26
 
23
27
  - Handle `IOError` raised while shutting down the pure Ruby interrupt pipe, so `IO::Event::Interrupt#close` does not leak expected shutdown errors from the interrupt fiber.
@@ -60,10 +64,6 @@ Please see the [project releases](https://socketry.github.io/io-event/releases/i
60
64
 
61
65
  - [Enhanced `IO::Event::PriorityHeap` with deletion and bulk insertion methods](https://socketry.github.io/io-event/releases/index#enhanced-io::event::priorityheap-with-deletion-and-bulk-insertion-methods)
62
66
 
63
- ### v1.11.2
64
-
65
- - Fix Windows build.
66
-
67
67
  ## Contributing
68
68
 
69
69
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v1.16.4
4
+
5
+ - Correctly implement `Interrupt#signal` so that it is robust enough to be called by `Scheduler#unblock`.
6
+
3
7
  ## v1.16.3
4
8
 
5
9
  - Handle `IOError` raised while shutting down the pure Ruby interrupt pipe, so `IO::Event::Interrupt#close` does not leak expected shutdown errors from the interrupt fiber.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.3
4
+ version: 1.16.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file