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 +4 -4
- data/lib/async/http/body/readable.rb +2 -5
- data/lib/async/http/body/streamable.rb +12 -0
- data/lib/async/http/pool.rb +15 -0
- data/lib/async/http/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f634672f23b766da861faa456972aeb07ca4a529f250e31dda8ce1366368f5
|
4
|
+
data.tar.gz: a48a4f025fe516339de4631330bfa4c19bb9c55cc94873ae3197797d55b5bf00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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`.
|
data/lib/async/http/pool.rb
CHANGED
@@ -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
|
data/lib/async/http/version.rb
CHANGED
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.
|
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-
|
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.
|
220
|
+
rubygems_version: 3.0.1
|
221
221
|
signing_key:
|
222
222
|
specification_version: 4
|
223
223
|
summary: A HTTP client and server library.
|