io-event 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44bfa6c2e533879211e047db7dc1e7ed75140b766fb06ae5bfcfd0bb8bf0e1fd
4
- data.tar.gz: 3144d4fb088de8328e27510cac3568722b0d67bdcc6d59291871cd02a9701995
3
+ metadata.gz: 2ac87cae13b6195eaa78351aff579000e12c3d9ed982d8202af4d745996a7a76
4
+ data.tar.gz: 1289b6e2f4c72ec34d5cdcb1565f5a9a96135a271a33370ac57ad958e4574da1
5
5
  SHA512:
6
- metadata.gz: ba89e2b85a129685f9cba7361245115541d7e1a278020bc56b67700a1fc9952b3e4f38b35e7bb3b962a4ac3a9ce58424650261d826a7c8a17d100b294d645605
7
- data.tar.gz: b0707e2b64b981f65ba2628d97c8e239b4bb54f686b358b9fff3de096e4dc01f8beb55acb3c5be97c77eaaa797aca501b29f0be6274c345dbdec88ef97b44bdb
6
+ metadata.gz: ecfb2339742c8f6bcfcdb1d263a3355a6a28d417d626a37c1ba20f68425b8cb4fe597a04b7b3464a09fd201192d0e23957393fc7975f09a29399eb9429096b74
7
+ data.tar.gz: 9690bdf7559834e9e3c5345c42fa8447188c5f2ee6a65983371432f3ffc69c1e5837f0364b57040e5e7a32f582b1d19580eb6c01d710951fa794953a2fc41079
data/ext/IO_Event.bundle CHANGED
Binary file
data/ext/event.o CHANGED
Binary file
data/ext/interrupt.o CHANGED
Binary file
data/ext/kqueue.o CHANGED
Binary file
data/ext/selector.o CHANGED
Binary file
@@ -141,7 +141,7 @@ module IO::Event
141
141
  # The maximum size we can read:
142
142
  maximum_size = buffer.size - offset
143
143
 
144
- case result = io.read_nonblock(maximum_size, exception: false)
144
+ case result = blocking{io.read_nonblock(maximum_size, exception: false)}
145
145
  when :wait_readable
146
146
  self.io_wait(fiber, io, IO::READABLE)
147
147
  when :wait_writable
@@ -165,7 +165,7 @@ module IO::Event
165
165
  while length > 0
166
166
  # From offset until the end:
167
167
  chunk = buffer.to_str(offset, length)
168
- case result = io.write_nonblock(chunk, exception: false)
168
+ case result = blocking{io.write_nonblock(chunk, exception: false)}
169
169
  when :wait_readable
170
170
  self.io_wait(fiber, io, IO::READABLE)
171
171
  when :wait_writable
@@ -240,6 +240,10 @@ module IO::Event
240
240
 
241
241
  return ready.size
242
242
  end
243
+
244
+ private def blocking(&block)
245
+ Fiber.new(blocking: true, &block).resume
246
+ end
243
247
  end
244
248
  end
245
249
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module IO::Event
22
- VERSION = "0.2.5"
22
+ VERSION = "0.2.6"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-11 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bake