async-pool 0.10.1 → 0.10.3

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: 003c7bc5ebfd789e4350f68af08301a24628b8782d1e9255ea69e6a92c74198a
4
- data.tar.gz: 064e1ab27d50b280718157bf8bef400ca0c0850bed547983ae945b78b59c159d
3
+ metadata.gz: 56a5ccdbbda423ade08a5f3ecbd9078cb0593ff6c0747f0abc28ab7821a1f3b7
4
+ data.tar.gz: 305a6dd845d03756c4b2a05d59fae42c1c847b693a8d8f6c1df3e146604ecc13
5
5
  SHA512:
6
- metadata.gz: 19ea0dc13e3a20bff67f5f3948187e6dc088acef4fb18a3d57a6c8f7c9d24bd4cf9dbd81128f59c818a9e55b216904e512b99c85667a024d24b7f070831342b8
7
- data.tar.gz: e39da4c0bc5c38cb7c5a1887976b08a5b0ec4c28195285e4a47b82d609f126326dbf2b3b5267c62dbe3615fd27c4f0a9afc7e07784840173bcde3ad3e652c20f
6
+ metadata.gz: 6647788461e0dda6cc136f9fde08bee8a3d81d66d3f1e56720e828d85cfaa90294c234892a45173c92571c706a790d0916e6238a1cc1cdf38b462032ae45d9ff
7
+ data.tar.gz: b7496e871d2d380bf8e5f181b4c53a21cfe61995ab4626f381db354cb33fcca72410691ce9a4bf2a8ed1a267a30c94efa837c9be8a66bab6607f128847281c41
checksums.yaml.gz.sig CHANGED
Binary file
@@ -11,8 +11,6 @@ require "async"
11
11
  require "async/notification"
12
12
  require "async/semaphore"
13
13
 
14
- require "traces"
15
-
16
14
  module Async
17
15
  module Pool
18
16
  # A resource pool controller.
@@ -161,6 +159,7 @@ module Async
161
159
  retire(resource) unless processed
162
160
  end
163
161
 
162
+ # Drain the pool, closing all resources.
164
163
  def drain
165
164
  Console.debug(self, "Draining pool...", size: @resources.size)
166
165
 
@@ -170,7 +169,7 @@ module Async
170
169
  end
171
170
  end
172
171
 
173
- # Close all resources in the pool.
172
+ # Drain the pool, clear all resources, and stop the gardener.
174
173
  def close
175
174
  self.drain
176
175
 
@@ -324,11 +323,7 @@ module Async
324
323
  def available_resource
325
324
  resource = nil
326
325
 
327
- Console.debug(self, "Acquiring concurrency guard...", blocking: @guard.blocking?)
328
-
329
326
  @guard.acquire do
330
- Console.debug(self, "Acquired concurrency guard.")
331
-
332
327
  resource = acquire_or_create_resource
333
328
  end
334
329
 
@@ -385,59 +380,6 @@ module Async
385
380
  return create_resource
386
381
  end
387
382
  end
388
-
389
- Traces::Provider(self) do
390
- def create_resource(...)
391
- attributes = {
392
- concurrency: @guard.limit,
393
- }
394
-
395
- attributes.merge!(@tags) if @tags
396
-
397
- Traces.trace('async.pool.create', attributes: attributes) {super}
398
- end
399
-
400
- def drain(...)
401
- attributes = {
402
- size: @resources.size,
403
- }
404
-
405
- attributes.merge!(@tags) if @tags
406
-
407
- Traces.trace('async.pool.drain', attributes: attributes) {super}
408
- end
409
-
410
- def acquire(...)
411
- attributes = {
412
- size: @resources.size,
413
- limit: @limit,
414
- }
415
-
416
- attributes.merge!(@tags) if @tags
417
-
418
- Traces.trace('async.pool.acquire', attributes: attributes) {super}
419
- end
420
-
421
- def release(...)
422
- attributes = {
423
- size: @resources.size,
424
- }
425
-
426
- attributes.merge!(@tags) if @tags
427
-
428
- Traces.trace('async.pool.release', attributes: attributes) {super}
429
- end
430
-
431
- def retire(...)
432
- attributes = {
433
- size: @resources.size,
434
- }
435
-
436
- attributes.merge!(@tags) if @tags
437
-
438
- Traces.trace('async.pool.retire', attributes: attributes) {super}
439
- end
440
- end
441
383
  end
442
384
  end
443
385
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Pool
8
- VERSION = "0.10.1"
8
+ VERSION = "0.10.3"
9
9
  end
10
10
  end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2025, by Samuel Williams.
5
+
6
+ require_relative "../../../../async/pool/controller"
7
+
8
+ Traces::Provider(Async::Pool::Controller) do
9
+ def create_resource(...)
10
+ attributes = {
11
+ concurrency: @guard.limit,
12
+ }
13
+
14
+ attributes.merge!(@tags) if @tags
15
+
16
+ Traces.trace("async.pool.create", attributes: attributes) {super}
17
+ end
18
+
19
+ def drain(...)
20
+ attributes = {
21
+ size: @resources.size,
22
+ }
23
+
24
+ attributes.merge!(@tags) if @tags
25
+
26
+ Traces.trace("async.pool.drain", attributes: attributes) {super}
27
+ end
28
+
29
+ def acquire(...)
30
+ attributes = {
31
+ size: @resources.size,
32
+ limit: @limit,
33
+ }
34
+
35
+ attributes.merge!(@tags) if @tags
36
+
37
+ Traces.trace("async.pool.acquire", attributes: attributes) {super}
38
+ end
39
+
40
+ def release(...)
41
+ attributes = {
42
+ size: @resources.size,
43
+ }
44
+
45
+ attributes.merge!(@tags) if @tags
46
+
47
+ Traces.trace("async.pool.release", attributes: attributes) {super}
48
+ end
49
+
50
+ def retire(...)
51
+ attributes = {
52
+ size: @resources.size,
53
+ }
54
+
55
+ attributes.merge!(@tags) if @tags
56
+
57
+ Traces.trace("async.pool.retire", attributes: attributes) {super}
58
+ end
59
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Olle Jonsson
9
9
  - Simon Perepelitsa
10
10
  - Thomas Morgan
11
- autorequire:
12
11
  bindir: bin
13
12
  cert_chain:
14
13
  - |
@@ -40,7 +39,7 @@ cert_chain:
40
39
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
40
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
41
  -----END CERTIFICATE-----
43
- date: 2024-10-13 00:00:00.000000000 Z
42
+ date: 2025-02-01 00:00:00.000000000 Z
44
43
  dependencies:
45
44
  - !ruby/object:Gem::Dependency
46
45
  name: async
@@ -56,22 +55,6 @@ dependencies:
56
55
  - - ">="
57
56
  - !ruby/object:Gem::Version
58
57
  version: '1.25'
59
- - !ruby/object:Gem::Dependency
60
- name: traces
61
- requirement: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: '0'
73
- description:
74
- email:
75
58
  executables: []
76
59
  extensions: []
77
60
  extra_rdoc_files: []
@@ -80,6 +63,7 @@ files:
80
63
  - lib/async/pool/controller.rb
81
64
  - lib/async/pool/resource.rb
82
65
  - lib/async/pool/version.rb
66
+ - lib/traces/provider/async/pool/controller.rb
83
67
  - license.md
84
68
  - readme.md
85
69
  homepage: https://github.com/socketry/async-pool
@@ -89,7 +73,6 @@ metadata:
89
73
  documentation_uri: https://socketry.github.io/async-pool/
90
74
  funding_uri: https://github.com/sponsors/ioquatix/
91
75
  source_code_uri: https://github.com/socketry/async-pool.git
92
- post_install_message:
93
76
  rdoc_options: []
94
77
  require_paths:
95
78
  - lib
@@ -104,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
87
  - !ruby/object:Gem::Version
105
88
  version: '0'
106
89
  requirements: []
107
- rubygems_version: 3.5.11
108
- signing_key:
90
+ rubygems_version: 3.6.2
109
91
  specification_version: 4
110
92
  summary: A singleplex and multiplex resource pool for implementing robust clients.
111
93
  test_files: []
metadata.gz.sig CHANGED
@@ -1 +1,4 @@
1
- -LZH\uL2Pl��ۭYk�����Z���6�����rQ�%�6����0�'�?�����c��s�۸��"��c^�|��KZ����-M] ���_+���-����}&T�i�%��V~4���g��|4!��Y�w�q�/�Ӡ��9叡�!Y<���V_ֽ�p0)
1
+ ?Bqwo��c�R�'�~eH&��.���h��:u���9�-t:T�TX�כ�FXh�w�:��$������[s�� j-�_K�(BI
2
+ ����!����~���rLJ�t)G��&�#�6�+!�9�f���c&�
3
+ bW��F�nH=�|d~��[����q�����V���dd�ðݕf!z:��_�^>���F(��7�j�O��j6��x��,~a\����������܀�﫬H�bC��"������
4
+ ����������>� S