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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: d73f7b5d5807b912d7983ea4c4242097110bfb969887516d20b4287265a33b7e
4
- data.tar.gz: 48c55839468556a1e263389af03b507b5b294e6c756c72d886420352dba5c6c8
2
+ SHA1:
3
+ metadata.gz: eaeb8a35292eab6b85c49779994816e8d6355427
4
+ data.tar.gz: a97badcaa4eb6c8cbfa37ca4609d9f45b93b6e71
5
5
  SHA512:
6
- metadata.gz: d6cea2bba74670b408a1e11921073b58aa7918c037c991c14512c0bd819343ef4853d7036db9c6f65a05a02c7c6a73757b636a5b6bc4cece7c530b82d8244c3f
7
- data.tar.gz: c74f6fdaf91db6544161227b9cd3c1dca14a7addbd5889b2c8df399dea4b21752109a1754b4c62c858caf8b2942862e927587c154b23c7d0c994697546a7a3d4
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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Async
22
- VERSION = "1.2.1"
22
+ VERSION = "1.2.2"
23
23
  end
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
- @monitor.value = nil if @monitor
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.1
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-01 00:00:00.000000000 Z
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.7.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.