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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36dfa0c90392d3f6e3582b1bdd3e2fdb7667ddccb601fb4dd34df3e8aa3baa2e
4
- data.tar.gz: bea9381873eed77a2fd9dcb4d90190e9fa3ebbbba0f38c5628ee369f5da58a97
3
+ metadata.gz: cc9d27508f2aedf6acd28b377ecedf2a05a1b8d18441aa523e5ddcdb1f3a726b
4
+ data.tar.gz: b18617893727bbe6d2a90adaafdcc7e92d8847c4ecb3a7caa519e183a7439be7
5
5
  SHA512:
6
- metadata.gz: 7ece710c9d7ec8fcb62b92ae9fb19775de4f781f886a3b9e285f08a0a9483599bc15e6b5d727df7697202f1b11381cba5ebb731d84ad9236abc4c29d8293a508
7
- data.tar.gz: 02d545782a0b63b7ba74ce19a450ab7851886548eb71805c2fd9e5b71f8daf838c5dfbd5013b6bec2b639a2f630a5dfc846baaf9b28581cf53cb26d9b975290d
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
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module Pool
23
- VERSION = "0.3.7"
23
+ VERSION = "0.3.8"
24
24
  end
25
25
  end
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.7
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-06-06 00:00:00.000000000 Z
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.3.0.dev
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.