async-http 0.80.0 → 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: 5a73103da274cc4cac5838409d95a05f1c8a746e0b58dcee062031886061ffb7
4
- data.tar.gz: da1d5991f78d71c2ab1a3c8ace1d0d8c53831b545bdcfe2f3e93d095bd6389bd
3
+ metadata.gz: 1d568651092adf60463aa881e3d8f3df116358a0e8bd46f521d18c0878b89d3e
4
+ data.tar.gz: f7910bf26008caaaae2a00cec6e02bb9c6c8a4ba494c6d8061e9411ecd60fe35
5
5
  SHA512:
6
- metadata.gz: 4169f9f110a07db5f27b6e083b09b1c6d3f0940269b1d423150993a491c4f3d46dfa4ae227712502b07d4cf949b0186e1e838fa3b77cead2809ee73c30e4500c
7
- data.tar.gz: a85d33bd88881433c1c33b369027d6ff4f1c095b26ecac5b583b865fe2f8011c6ee7bba6c6f9857c5b1cf1697c4298a5e4c6506da3584d0215682bd4beea9858
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)
@@ -14,6 +14,11 @@ require "io/endpoint/ssl_endpoint"
14
14
  require_relative "protocol/http"
15
15
  require_relative "protocol/https"
16
16
 
17
+ require "uri"
18
+
19
+ # Compatibility with Ruby 3.1.2
20
+ require "uri/wss"
21
+
17
22
  module Async
18
23
  module HTTP
19
24
  # Represents a way to connect to a remote HTTP server.
@@ -43,7 +43,8 @@ module Async
43
43
 
44
44
  def read_line?
45
45
  @stream.read_until(CRLF)
46
- rescue Errno::ECONNRESET
46
+ rescue => error
47
+ # Bascially, any error will cause the connection to be closed:
47
48
  return nil
48
49
  end
49
50
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module HTTP
8
- VERSION = "0.80.0"
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.0
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-02 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