async-http 0.37.12 → 0.37.13

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: 357920d7385810d51149004ef9dffe390046cfd0f73766567188ad107bdbd738
4
- data.tar.gz: 58523b0bd24245c299937e5ba2e3c0de6afe0811e11c83db2fea3d2019521af1
3
+ metadata.gz: 90f634672f23b766da861faa456972aeb07ca4a529f250e31dda8ce1366368f5
4
+ data.tar.gz: a48a4f025fe516339de4631330bfa4c19bb9c55cc94873ae3197797d55b5bf00
5
5
  SHA512:
6
- metadata.gz: 9c5202d7cc4c61aed8e2eae0b15a509562fe51117409f10a2505c64a461c0aa5763463a5de2016c9d414d1c87e26eb2d0d04fd132a7d97b94c059a2d44feeb63
7
- data.tar.gz: 39666f6fc703124c4f84dbd6efdb42807d8e86a6a56bd460bb474dece8c1f7fa47e7608bc521f163a113b963f9d42bcb432835a95620b209f58f1a29a85cb4f8
6
+ metadata.gz: 427aae67693267c1973852063d3f83c6e88ef7923d731dc606e04f00334847e1f6ca05543664f92e944228666db6af93ca6f7ffb3924cbcad28d736a7e479051
7
+ data.tar.gz: '0973e4c7ea4a311761bddbaf1e8287b47315a21d4a7d855382f16dc01d573538fc0d2de65dcf9cc8a42d3875a3c0b291c7de409fb22af8018a1c034a1230d50d'
@@ -45,11 +45,8 @@ module Async
45
45
 
46
46
  # Read all remaining chunks into a buffered body and close the underlying input.
47
47
  def finish
48
- buffered = Buffered.for(self)
49
-
50
- self.close
51
-
52
- return buffered
48
+ # Internally, this invokes `self.each` which then invokes `self.close`.
49
+ Buffered.for(self)
53
50
  end
54
51
 
55
52
  # Enumerate all chunks until finished, then invoke `#close`.
@@ -44,6 +44,18 @@ module Async
44
44
  @remaining = remaining
45
45
  end
46
46
 
47
+ def finish
48
+ if @body
49
+ result = super
50
+
51
+ @callback.call
52
+
53
+ @body = nil
54
+
55
+ return result
56
+ end
57
+ end
58
+
47
59
  def close(*)
48
60
  if @body
49
61
  super
@@ -48,6 +48,19 @@ module Async
48
48
  @constructor = block
49
49
  end
50
50
 
51
+ # The number of allocated resources.
52
+ attr :active
53
+
54
+ # Whether there are resources which are currently in use.
55
+ def busy?
56
+ @resources.collect do |_,usage|
57
+ return true if usage > 0
58
+ end
59
+
60
+ return false
61
+ end
62
+
63
+ # All allocated resources.
51
64
  attr :resources
52
65
 
53
66
  def empty?
@@ -94,6 +107,8 @@ module Async
94
107
  end
95
108
 
96
109
  def reuse(resource)
110
+ Async.logger.debug(self) {"Reuse #{resource}"}
111
+
97
112
  @resources[resource] -= 1
98
113
 
99
114
  @available.signal
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.37.12"
23
+ VERSION = "0.37.13"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.12
4
+ version: 0.37.13
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-23 00:00:00.000000000 Z
11
+ date: 2019-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  - !ruby/object:Gem::Version
218
218
  version: '0'
219
219
  requirements: []
220
- rubygems_version: 3.0.2
220
+ rubygems_version: 3.0.1
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: A HTTP client and server library.