async-http 0.80.1 → 0.81.0

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: 6563a3eb6c06ca33e6038985b9f4e4608355f8179d010b009f37ae33bb5db906
4
- data.tar.gz: ca7d4e2483b0a9c9e277fbbca2741de22e351240b5498317f8373b05c7d6ab3c
3
+ metadata.gz: 1d568651092adf60463aa881e3d8f3df116358a0e8bd46f521d18c0878b89d3e
4
+ data.tar.gz: f7910bf26008caaaae2a00cec6e02bb9c6c8a4ba494c6d8061e9411ecd60fe35
5
5
  SHA512:
6
- metadata.gz: f9f2673c93c361ba9afa178c9a7742aeb2848e44ccec6a483a06694655c9a37364ccd76218f76e111522b8d951ccbe89dee8a32f14a685f134cedaf108e33921
7
- data.tar.gz: d273737eb122e13aa9464420bde93a57488e608d41f2c4006f44e9083b6057a20a3904af0db07fa2ab9b564afdceeb40d30823bc6dd9b70460d6a88644a053b3
6
+ metadata.gz: bf77f7faf627288367541ce42305c6f011974f683314b6aff2799dcef685336aaf0a2ea9397b6bbc32a4f59567a9fb3e757ce10d177f1779c204feb1a14a3ab2
7
+ data.tar.gz: 1961f2216b13441e8d25c7f4b64c84989065bb998fb298655079040754bfd8d6f072a08a7134957ea5b624517d0ab0cf2663570ce13f825b44a15584fcf4adc2
checksums.yaml.gz.sig CHANGED
Binary file
@@ -18,7 +18,6 @@ require_relative "protocol"
18
18
  module Async
19
19
  module HTTP
20
20
  DEFAULT_RETRIES = 3
21
- DEFAULT_CONNECTION_LIMIT = nil
22
21
 
23
22
  class Client < ::Protocol::HTTP::Methods
24
23
  # Provides a robust interface to a server.
@@ -30,12 +29,12 @@ module Async
30
29
  # @param protocol [Protocol::HTTP1 | Protocol::HTTP2 | Protocol::HTTPS] the protocol to use.
31
30
  # @param scheme [String] The default scheme to set to requests.
32
31
  # @param authority [String] The default authority to set to requests.
33
- def initialize(endpoint, protocol: endpoint.protocol, scheme: endpoint.scheme, authority: endpoint.authority, retries: DEFAULT_RETRIES, connection_limit: DEFAULT_CONNECTION_LIMIT)
32
+ def initialize(endpoint, protocol: endpoint.protocol, scheme: endpoint.scheme, authority: endpoint.authority, retries: DEFAULT_RETRIES, **options)
34
33
  @endpoint = endpoint
35
34
  @protocol = protocol
36
35
 
37
36
  @retries = retries
38
- @pool = make_pool(connection_limit)
37
+ @pool = make_pool(**options)
39
38
 
40
39
  @scheme = scheme
41
40
  @authority = authority
@@ -191,8 +190,20 @@ module Async
191
190
  return response
192
191
  end
193
192
 
194
- def make_pool(connection_limit)
195
- Async::Pool::Controller.wrap(limit: connection_limit) do
193
+ def assign_default_tags(tags)
194
+ tags[:endpoint] = @endpoint.to_s
195
+ tags[:protocol] = @protocol.to_s
196
+ end
197
+
198
+ def make_pool(**options)
199
+ if connection_limit = options.delete(:connection_limit)
200
+ warn "The connection_limit: option is deprecated, please use limit: instead.", uplevel: 2
201
+ options[:limit] = connection_limit
202
+ end
203
+
204
+ self.assign_default_tags(options[:tags] ||= {})
205
+
206
+ Async::Pool::Controller.wrap(**options) do
196
207
  Console.logger.debug(self) {"Making connection to #{@endpoint.inspect}"}
197
208
 
198
209
  @protocol.client(@endpoint.connect)
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module HTTP
8
- VERSION = "0.80.1"
8
+ VERSION = "0.81.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -16,6 +16,10 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
16
16
 
17
17
  Please see the [project releases](https://socketry.github.io/async-http/releases/index) for all releases.
18
18
 
19
+ ### v0.81.0
20
+
21
+ - Expose `protocol` and `endpoint` as tags to `async-pool` for improved instrumentation.
22
+
19
23
  ### v0.77.0
20
24
 
21
25
  - Improved HTTP/1 connection handling.
@@ -29,7 +33,7 @@ Please see the [project releases](https://socketry.github.io/async-http/releases
29
33
 
30
34
  ### v0.75.0
31
35
 
32
- - Better handling of HTTP/1 \&lt;-\&gt; HTTP/2 proxying, specifically upgrade/CONNECT requests.
36
+ - Better handling of HTTP/1 \<-\> HTTP/2 proxying, specifically upgrade/CONNECT requests.
33
37
 
34
38
  ### v0.74.0
35
39
 
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.81.0
4
+
5
+ - Expose `protocol` and `endpoint` as tags to `async-pool` for improved instrumentation.
6
+
3
7
  ## v0.77.0
4
8
 
5
9
  - Improved HTTP/1 connection handling.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.80.1
4
+ version: 0.81.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -58,7 +58,7 @@ cert_chain:
58
58
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
59
59
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
60
60
  -----END CERTIFICATE-----
61
- date: 2024-10-12 00:00:00.000000000 Z
61
+ date: 2024-10-13 00:00:00.000000000 Z
62
62
  dependencies:
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: async
@@ -80,28 +80,28 @@ dependencies:
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0.7'
83
+ version: '0.9'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0.7'
90
+ version: '0.9'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: io-endpoint
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0.11'
97
+ version: '0.14'
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '0.11'
104
+ version: '0.14'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: io-stream
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -162,16 +162,30 @@ dependencies:
162
162
  name: traces
163
163
  requirement: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - ">="
165
+ - - "~>"
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0.10'
168
168
  type: :runtime
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - ">="
172
+ - - "~>"
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0.10'
175
+ - !ruby/object:Gem::Dependency
176
+ name: metrics
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '0.12'
182
+ type: :runtime
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - "~>"
187
+ - !ruby/object:Gem::Version
188
+ version: '0.12'
175
189
  description:
176
190
  email:
177
191
  executables: []
metadata.gz.sig CHANGED
Binary file