async-io 1.42.1 → 1.43.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/io/generic.rb +4 -0
- data/lib/async/io/ssl_socket.rb +8 -4
- data/lib/async/io/stream.rb +21 -2
- data/lib/async/io/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 071d4c65cf79b0114f950285653b697d06949878a919fa256806f7c9dae40253
|
4
|
+
data.tar.gz: 5f9610ec6b8e8de0c4160c1e66d07b1549c9cbbf286bbb5443f033c5399ae549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f86354aec7425c48afb078885c6e80accbed2f534802a12063d190db78b129140ffd1739293072cd95e8b94b08870c1a1b856c7cd8931e0f45ff7ed909b4b830
|
7
|
+
data.tar.gz: 658b16d8c97799b3d5acfa7e78c2b4e542b9835ca2aa236ee378c39f612f4683fd17be6e3d924a2c673ccbadd021531f3c921bce1e82d35175c80a799a88d77e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/io/generic.rb
CHANGED
data/lib/async/io/ssl_socket.rb
CHANGED
@@ -51,10 +51,14 @@ module Async
|
|
51
51
|
super
|
52
52
|
else
|
53
53
|
io = self.class.wrapped_klass.new(socket.to_io, context)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
if socket.respond_to?(:reactor)
|
55
|
+
super(io, socket.reactor)
|
56
|
+
|
57
|
+
# We detach the socket from the reactor, otherwise it's possible to add the file descriptor to the selector twice, which is bad.
|
58
|
+
socket.reactor = nil
|
59
|
+
else
|
60
|
+
super(io)
|
61
|
+
end
|
58
62
|
|
59
63
|
# This ensures that when the internal IO is closed, it also closes the internal socket:
|
60
64
|
io.sync_close = true
|
data/lib/async/io/stream.rb
CHANGED
@@ -197,6 +197,10 @@ module Async
|
|
197
197
|
@io.connected?
|
198
198
|
end
|
199
199
|
|
200
|
+
def readable?
|
201
|
+
@io.readable?
|
202
|
+
end
|
203
|
+
|
200
204
|
def closed?
|
201
205
|
@io.closed?
|
202
206
|
end
|
@@ -246,6 +250,21 @@ module Async
|
|
246
250
|
|
247
251
|
private
|
248
252
|
|
253
|
+
def sysread(size, buffer)
|
254
|
+
while true
|
255
|
+
result = @io.read_nonblock(size, buffer, exception: false)
|
256
|
+
|
257
|
+
case result
|
258
|
+
when :wait_readable
|
259
|
+
@io.wait_readable
|
260
|
+
when :wait_writable
|
261
|
+
@io.wait_writable
|
262
|
+
else
|
263
|
+
return result
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
249
268
|
# Fills the buffer from the underlying stream.
|
250
269
|
def fill_read_buffer(size = @block_size)
|
251
270
|
# We impose a limit because the underlying `read` system call can fail if we request too much data in one go.
|
@@ -257,12 +276,12 @@ module Async
|
|
257
276
|
flush
|
258
277
|
|
259
278
|
if @read_buffer.empty?
|
260
|
-
if
|
279
|
+
if sysread(size, @read_buffer)
|
261
280
|
# Console.logger.debug(self, name: "read") {@read_buffer.inspect}
|
262
281
|
return true
|
263
282
|
end
|
264
283
|
else
|
265
|
-
if chunk =
|
284
|
+
if chunk = sysread(size, @input_buffer)
|
266
285
|
@read_buffer << chunk
|
267
286
|
# Console.logger.debug(self, name: "read") {@read_buffer.inspect}
|
268
287
|
|
data/lib/async/io/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -49,7 +49,7 @@ cert_chain:
|
|
49
49
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
50
50
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
51
51
|
-----END CERTIFICATE-----
|
52
|
-
date: 2024-04-
|
52
|
+
date: 2024-04-23 00:00:00.000000000 Z
|
53
53
|
dependencies:
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: async
|
metadata.gz.sig
CHANGED
Binary file
|