async-io 1.18.1 → 1.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/async/io/tcp_socket.rb +4 -2
- data/lib/async/io/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6af60edd4c664064f17db04a1146cbd88656068c1c0c95618674c6b5ce8c6943
|
4
|
+
data.tar.gz: fcf301863fabc8a477bddb0854e6e25d0c4d1ba5c783322eb4d4a392c228e435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95d4bca4d11cea4cdb29c7dbc904fae62c83a3232f6ce1d73631884bf326217c7735fe9c762092c26c1b3288226f82ab0ec4f222bd41f2863fb73282a5168769
|
7
|
+
data.tar.gz: ce9921bf2cbcefb702e3af88eb61e6797726baa09f2d855f806525c153a67264abb2af53eccc9a884dc47a81af09e27ac4f6a2ccb9e92ac32d0f55244c185e9b
|
data/README.md
CHANGED
@@ -76,7 +76,7 @@ end
|
|
76
76
|
Timeouts add a temporal limit to the execution of your code. If the IO doesn't respond in time, it will fail. Timeouts are high level concerns and you generally shouldn't use them except at the very highest level of your program.
|
77
77
|
|
78
78
|
```ruby
|
79
|
-
message = task.
|
79
|
+
message = task.with_timeout(5) do
|
80
80
|
begin
|
81
81
|
peer.read(512)
|
82
82
|
rescue Async::TimeoutError
|
@@ -92,7 +92,7 @@ Any `yield` operation can cause a timeout to trigger. Non-`async` functions migh
|
|
92
92
|
Asynchronous operations may block forever. You can assign a per-wrapper operation timeout duration. All asynchronous operations will be bounded by this timeout.
|
93
93
|
|
94
94
|
```ruby
|
95
|
-
peer.
|
95
|
+
peer.timeout = 1
|
96
96
|
peer.read(512) # If this takes more than 1 second, Async::TimeoutError will be raised.
|
97
97
|
```
|
98
98
|
|
data/lib/async/io/tcp_socket.rb
CHANGED
@@ -110,11 +110,13 @@ module Async
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
def accept(task: Task.current)
|
114
|
-
peer, address = async_send(:accept_nonblock)
|
113
|
+
def accept(timeout: nil, task: Task.current)
|
114
|
+
peer, address = async_send(:accept_nonblock, timeout: timeout)
|
115
115
|
|
116
116
|
wrapper = TCPSocket.new(peer)
|
117
117
|
|
118
|
+
wrapper.timeout = self.timeout
|
119
|
+
|
118
120
|
return wrapper, address unless block_given?
|
119
121
|
|
120
122
|
begin
|
data/lib/async/io/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|