rxio 1.2.3 → 1.2.4
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
- data/lib/rxio/io_base.rb +11 -3
- data/lib/rxio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 061b52b3f4d31432e5d37fe78588d6b611fb8f7a
|
4
|
+
data.tar.gz: 71a684798b57c87112b8e7b7d5211dfed3e2bc33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2165483d9a090954fc497b3337cf4b2c176e975634319baabe67ea0a5ecde447dcd29b3ce2b4ca12cbb478eefacedebc6f6a350138782faa1b171bf8e776175e
|
7
|
+
data.tar.gz: 528ab8ffb45bff289391c7b735b239112b77cff431f0ff9b032de426d1bf8226092adc003a807ff36f0ca164e3a18e2a07bc9532def20d49418d7e9048176ffe
|
data/lib/rxio/io_base.rb
CHANGED
@@ -10,6 +10,12 @@ module RxIO
|
|
10
10
|
# Chunk Size
|
11
11
|
CHUNK_SIZE = 1024
|
12
12
|
|
13
|
+
# Retry Exceptions
|
14
|
+
RETRY_EXCEPTIONS = [
|
15
|
+
OpenSSL::SSL::SSLErrorWaitReadable,
|
16
|
+
IO::EAGAINWaitReadable
|
17
|
+
]
|
18
|
+
|
13
19
|
# Process Input:
|
14
20
|
# Processes Input for an Endpoint, in the form of a data chunk.
|
15
21
|
# @param [Hash] endpoint
|
@@ -51,16 +57,18 @@ module RxIO
|
|
51
57
|
# Therefore we loop until we either have an explicit error or a signal to wait.
|
52
58
|
done = false
|
53
59
|
chunk = ''
|
60
|
+
rdstr = ''
|
54
61
|
until done || !chunk
|
55
62
|
begin
|
56
|
-
|
63
|
+
rdstr = s.read_nonblock(CHUNK_SIZE)
|
64
|
+
chunk << rdstr if rdstr
|
57
65
|
rescue Exception => ex
|
58
|
-
if
|
66
|
+
if RETRY_EXCEPTIONS.include? ex.class; then done = true; else rdstr = nil; end
|
59
67
|
end
|
60
68
|
end
|
61
69
|
|
62
70
|
# Drop Endpoint & Abort on Error
|
63
|
-
return drop_endpoint e unless
|
71
|
+
return drop_endpoint e unless rdstr
|
64
72
|
|
65
73
|
# Process Input
|
66
74
|
process_input e, chunk
|
data/lib/rxio/version.rb
CHANGED