async-io 1.36.0 → 1.38.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/async/io/stream.rb +13 -2
- data/lib/async/io/unix_endpoint.rb +2 -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: 3b7b3f7b1f99d0f76bb82952decb91db243b03701816487be7994fe21a44a367
|
4
|
+
data.tar.gz: 3d4fb5452bad6c72e0dfcc05a0e29ab3711007b87b2bca0962cec3d1dc8126b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53585eab5d5b7713182f47a030beaddbcccc77faf3bdb8f90d5d7d178167dcf63f627580225e813558da9ac61cbe5f9d005d0787666ef566e34deb527fedd79a
|
7
|
+
data.tar.gz: cef5bfceb64437f36cdd4c8391705ba9fcb10c754c96eebab8a3dc0eaabf3e819054e229d38d2f72763e36bc2d2791cc635652219e01ec3baf07b3bacaf22d7d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/io/stream.rb
CHANGED
@@ -125,10 +125,21 @@ module Async
|
|
125
125
|
return matched
|
126
126
|
end
|
127
127
|
|
128
|
-
def peek
|
129
|
-
|
128
|
+
def peek(size = nil)
|
129
|
+
if size
|
130
|
+
until @eof or @read_buffer.bytesize >= size
|
131
|
+
# Compute the amount of data we need to read from the underlying stream:
|
132
|
+
read_size = size - @read_buffer.bytesize
|
133
|
+
|
134
|
+
# Don't read less than @block_size to avoid lots of small reads:
|
135
|
+
fill_read_buffer(read_size > @block_size ? read_size : @block_size)
|
136
|
+
end
|
137
|
+
return @read_buffer.slice(0, [size, @read_buffer.size].min)
|
138
|
+
end
|
139
|
+
until (block_given? && yield(@read_buffer)) or @eof
|
130
140
|
fill_read_buffer
|
131
141
|
end
|
142
|
+
return @read_buffer
|
132
143
|
end
|
133
144
|
|
134
145
|
def gets(separator = $/, **options)
|
@@ -35,8 +35,8 @@ module Async
|
|
35
35
|
Socket.bind(@address, **@options, &block)
|
36
36
|
rescue Errno::EADDRINUSE
|
37
37
|
# If you encounter EADDRINUSE from `bind()`, you can check if the socket is actually accepting connections by attempting to `connect()` to it. If the socket is still bound by an active process, the connection will succeed. Otherwise, it should be safe to `unlink()` the path and try again.
|
38
|
-
if !bound?
|
39
|
-
File.unlink(@path)
|
38
|
+
if !bound?
|
39
|
+
File.unlink(@path) rescue nil
|
40
40
|
retry
|
41
41
|
else
|
42
42
|
raise
|
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.38.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -46,7 +46,7 @@ cert_chain:
|
|
46
46
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
47
47
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
48
48
|
-----END CERTIFICATE-----
|
49
|
-
date: 2023-
|
49
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
50
50
|
dependencies:
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: async
|
metadata.gz.sig
CHANGED
Binary file
|