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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22ab50a346a6b3a70840063e6c89b136be1bf6a1a1368a2350bc43613249863e
4
- data.tar.gz: f797366850b5e7924f371ee6356331277626940e421eaff48ccce49c13a4b4af
3
+ metadata.gz: 98127286e0bfcfd823b663adec90587de5148f282cdad684a684c5eb2a057595
4
+ data.tar.gz: 41e3f054780a65fdf41f83996281a1f2720712a55ba1582939a60beeb7101303
5
5
  SHA512:
6
- metadata.gz: b9baea0d3389daf96359f4865dac6e3fad380f706c579815bfb8d818f09593b9a09a04f0d44d18a21c7e63449963e3d3c6ea5dcfffc2421e0a6b91c4db80b7a4
7
- data.tar.gz: 59e2865c43bb179598e431592222d76e45906cc12be1013831e43306cd46d88795a92ee132aface5c12bc87457b2f3e9a7e942bedf0b3e47d4db73e03cbf9db2
6
+ metadata.gz: 4144ccb9ff5d96ef0d8f7aa56bce33d92333809ce827d860f5b8e604cede4751674a070a4ac0df97dee348ab039f5aa1b25bf4f8f3c723809dd4fe7281bd44e4
7
+ data.tar.gz: 59de415924836ae327e5c3089f1b458ef46bc4152b4c97b54f55998a3075035608c68ff2cc30414ed2458c36537a1c0a0b3c6c8833a1eb448550da7ce00f29bf
checksums.yaml.gz.sig CHANGED
Binary file
@@ -70,7 +70,25 @@ module IO::Stream
70
70
  end
71
71
 
72
72
  def syswrite(buffer)
73
- @io.write(buffer)
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.
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2023-2024, by Samuel Williams.
5
5
 
6
6
  module IO::Stream
7
- VERSION = "0.1.1"
7
+ VERSION = "0.2.0"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file