async 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -0
- data/lib/async/reactor.rb +1 -1
- data/lib/async/version.rb +1 -1
- data/lib/async/wrapper.rb +15 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eaeb8a35292eab6b85c49779994816e8d6355427
|
4
|
+
data.tar.gz: a97badcaa4eb6c8cbfa37ca4609d9f45b93b6e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6017907e393996093d196a36434d469acd824958d90ca560cff85ef6c1b8bfbb4e10e96c712d7542f106dcef9beb6e5aeb10d70cd9c4af9b058383b42434949
|
7
|
+
data.tar.gz: 7330ce6f3aa50afcba05c5ec2b90cf8c1653176104c0fdbb4c006315f9ab8409aa8a8daae00dbef0cadb6b11d5867bab7b7df250de7d966cf3b6c1e018a75cf9
|
data/README.md
CHANGED
@@ -139,6 +139,8 @@ dropped.
|
|
139
139
|
## See Also
|
140
140
|
|
141
141
|
- [async-io](https://github.com/socketry/async-io) — Asynchronous networking and sockets.
|
142
|
+
- [async-http](https://github.com/socketry/async-http) — Asynchronous HTTP client/server.
|
143
|
+
- [falcon](https://github.com/socketry/falcon) — A rack compatible server built on top of `async-http`.
|
142
144
|
- [async-process](https://github.com/socketry/async-process) — Asynchronous process spawning/waiting.
|
143
145
|
- [async-websocket](https://github.com/socketry/async-websocket) — Asynchronous client and server websockets.
|
144
146
|
- [async-dns](https://github.com/socketry/async-dns) — Asynchronous DNS resolver and server.
|
data/lib/async/reactor.rb
CHANGED
@@ -139,7 +139,7 @@ module Async
|
|
139
139
|
# Async.logger.debug{"[#{self}] @children.empty? = #{@children.empty?} && interval #{interval.inspect}"}
|
140
140
|
return if @children.empty? && interval.nil?
|
141
141
|
|
142
|
-
# Async.logger.debug{"Selecting with #{@children.count} fibers interval = #{interval}..."}
|
142
|
+
# Async.logger.debug{"Selecting with #{@children.count} fibers interval = #{interval.inspect}..."}
|
143
143
|
if monitors = @selector.select(interval)
|
144
144
|
monitors.each do |monitor|
|
145
145
|
if fiber = monitor.value
|
data/lib/async/version.rb
CHANGED
data/lib/async/wrapper.rb
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
|
+
require 'nio'
|
22
|
+
|
21
23
|
module Async
|
22
24
|
# Represents an asynchronous IO within a reactor.
|
23
25
|
class Wrapper
|
@@ -70,6 +72,18 @@ module Async
|
|
70
72
|
end
|
71
73
|
end
|
72
74
|
|
75
|
+
if ::NIO::VERSION >= "2.0"
|
76
|
+
def clear_monitor
|
77
|
+
if @monitor
|
78
|
+
# Alas, @monitor.interests = nil does not yet work.
|
79
|
+
@monitor.value = nil
|
80
|
+
@monitor.remove_interest(@monitor.interests)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
else
|
84
|
+
alias clear_monitor close_monitor
|
85
|
+
end
|
86
|
+
|
73
87
|
# Monitor the io for the given events
|
74
88
|
def monitor(interests, duration = nil)
|
75
89
|
unless @monitor
|
@@ -91,7 +105,7 @@ module Async
|
|
91
105
|
|
92
106
|
return true
|
93
107
|
ensure
|
94
|
-
|
108
|
+
clear_monitor
|
95
109
|
end
|
96
110
|
end
|
97
111
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.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: 2018-02-
|
11
|
+
date: 2018-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nio4r
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.6.12
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Async is an asynchronous I/O framework based on nio4r.
|