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 +4 -4
- data/ext/IO_Event.bundle +0 -0
- data/ext/event.o +0 -0
- data/ext/interrupt.o +0 -0
- data/ext/kqueue.o +0 -0
- data/ext/selector.o +0 -0
- data/lib/io/event/selector/select.rb +6 -2
- data/lib/io/event/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ac87cae13b6195eaa78351aff579000e12c3d9ed982d8202af4d745996a7a76
|
4
|
+
data.tar.gz: 1289b6e2f4c72ec34d5cdcb1565f5a9a96135a271a33370ac57ad958e4574da1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/io/event/version.rb
CHANGED
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.
|
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
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bake
|