async-pool 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/pool/controller.rb +7 -3
- data/lib/async/pool/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc9d27508f2aedf6acd28b377ecedf2a05a1b8d18441aa523e5ddcdb1f3a726b
|
4
|
+
data.tar.gz: b18617893727bbe6d2a90adaafdcc7e92d8847c4ecb3a7caa519e183a7439be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39fe6f2c7f4eae7c215c779c1989814fb6f7126aaa6963ec8ee2c73f3f20132b4a985de53819a064f2fab5813a25131bf907c72e0b13758f24a17b6543a01072
|
7
|
+
data.tar.gz: e7f584de1b1bea95655e00b76b167268d74ae54f76e15a6bee614513575f7d3f7e108bade126a8c2c598a4fd8bde8857a8d26481842ef5eac5b00551d9550f07
|
@@ -98,12 +98,14 @@ module Async
|
|
98
98
|
|
99
99
|
# Make the resource resources and let waiting tasks know that there is something resources.
|
100
100
|
def release(resource)
|
101
|
+
reused = false
|
102
|
+
|
101
103
|
# A resource that is not good should also not be reusable.
|
102
104
|
if resource.reusable?
|
103
|
-
reuse(resource)
|
104
|
-
else
|
105
|
-
retire(resource)
|
105
|
+
reused = reuse(resource)
|
106
106
|
end
|
107
|
+
ensure
|
108
|
+
retire(resource) unless reused
|
107
109
|
end
|
108
110
|
|
109
111
|
def close
|
@@ -229,6 +231,8 @@ module Async
|
|
229
231
|
@resources[resource] = usage - 1
|
230
232
|
|
231
233
|
@notification.signal
|
234
|
+
|
235
|
+
return true
|
232
236
|
end
|
233
237
|
|
234
238
|
def wait_for_resource
|
data/lib/async/pool/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-pool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.25'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.25'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.2.22
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: A singleplex and multiplex resource pool for implementing robust clients.
|