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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 123cd8404fb47fe4beed0cac26b5b1f6825eb34b6a7e9952ef571c6103f72fab
4
- data.tar.gz: c2313c72cd403abddfc5a7235f82c7983639501db2ce664792e46d09cfca7ebe
3
+ metadata.gz: 6af60edd4c664064f17db04a1146cbd88656068c1c0c95618674c6b5ce8c6943
4
+ data.tar.gz: fcf301863fabc8a477bddb0854e6e25d0c4d1ba5c783322eb4d4a392c228e435
5
5
  SHA512:
6
- metadata.gz: 7fa15dba98d1c12d00ddfdfd2410cefa1767ef946d58751c2a1498b4226ee74a10255f38749c618275116f2b49f081a9d07518cfe4eb1f82416618db27d04426
7
- data.tar.gz: df87e800a13784df609488498dba29c72220aac213745e470628f650d0f031dc321b2463e079502a553e5a32aea7d95b6c690d229aa9d5f6201c3e8e45063575
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.timeout(5) do
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.timeout_duration = 1
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
 
@@ -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
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module IO
23
- VERSION = "1.18.1"
23
+ VERSION = "1.18.2"
24
24
  end
25
25
  end
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.1
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-19 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async