io-stream 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/io/stream/buffered.rb +19 -1
- data/lib/io/stream/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98127286e0bfcfd823b663adec90587de5148f282cdad684a684c5eb2a057595
|
4
|
+
data.tar.gz: 41e3f054780a65fdf41f83996281a1f2720712a55ba1582939a60beeb7101303
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4144ccb9ff5d96ef0d8f7aa56bce33d92333809ce827d860f5b8e604cede4751674a070a4ac0df97dee348ab039f5aa1b25bf4f8f3c723809dd4fe7281bd44e4
|
7
|
+
data.tar.gz: 59de415924836ae327e5c3089f1b458ef46bc4152b4c97b54f55998a3075035608c68ff2cc30414ed2458c36537a1c0a0b3c6c8833a1eb448550da7ce00f29bf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/io/stream/buffered.rb
CHANGED
@@ -70,7 +70,25 @@ module IO::Stream
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def syswrite(buffer)
|
73
|
-
|
73
|
+
# This fails due to re-entrancy issues with a concurrent call to `sysclose`.
|
74
|
+
# return @io.write(buffer)
|
75
|
+
|
76
|
+
while true
|
77
|
+
result = @io.write_nonblock(buffer, exception: false)
|
78
|
+
|
79
|
+
case result
|
80
|
+
when :wait_readable
|
81
|
+
@io.wait_readable
|
82
|
+
when :wait_writable
|
83
|
+
@io.wait_writable
|
84
|
+
else
|
85
|
+
if result == buffer.bytesize
|
86
|
+
return
|
87
|
+
else
|
88
|
+
buffer = buffer.byteslice(result, buffer.bytesize)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
74
92
|
end
|
75
93
|
|
76
94
|
# Reads data from the underlying stream as efficiently as possible.
|
data/lib/io/stream/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|