async-http 0.80.1 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/http/client.rb +16 -5
- data/lib/async/http/protocol/http1/connection.rb +0 -11
- data/lib/async/http/version.rb +1 -1
- data/readme.md +9 -1
- data/releases.md +8 -0
- data.tar.gz.sig +0 -0
- metadata +28 -14
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78fb5808dae4ef161e8ae21a72c9ec06dd740eced5e7afcc57b7de091f728ffa
|
4
|
+
data.tar.gz: 0d9b421eb5f7130983b1d5903da05b113718fdfcaef497eeace3dae0a57c98d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e807158cf95b6f822bc84d8592c296c2bff6700985372c54425a679385383ab23c143cd0e615bf9f3a5b0450a602ce3862cfa3bbdf93426cd680993b94d6a74d
|
7
|
+
data.tar.gz: 2585ec5a381fc5c2411ed6205cae1879534aff66c250b50f61acf4d9d4a0c50fdaf8a997baa29191b32effdde185f5e4b33101d99095f8ac8a51e3fae44f0c33
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/http/client.rb
CHANGED
@@ -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,
|
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(
|
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
|
195
|
-
|
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)
|
@@ -41,17 +41,6 @@ module Async
|
|
41
41
|
false
|
42
42
|
end
|
43
43
|
|
44
|
-
def read_line?
|
45
|
-
@stream.read_until(CRLF)
|
46
|
-
rescue => error
|
47
|
-
# Bascially, any error will cause the connection to be closed:
|
48
|
-
return nil
|
49
|
-
end
|
50
|
-
|
51
|
-
def read_line
|
52
|
-
@stream.read_until(CRLF) or raise EOFError, "Could not read line!"
|
53
|
-
end
|
54
|
-
|
55
44
|
def peer
|
56
45
|
@stream.io
|
57
46
|
end
|
data/lib/async/http/version.rb
CHANGED
data/readme.md
CHANGED
@@ -16,6 +16,14 @@ 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.82.0
|
20
|
+
|
21
|
+
- `protocol-http1` introduces a line length limit for request line, response line, header lines and chunk length lines.
|
22
|
+
|
23
|
+
### v0.81.0
|
24
|
+
|
25
|
+
- Expose `protocol` and `endpoint` as tags to `async-pool` for improved instrumentation.
|
26
|
+
|
19
27
|
### v0.77.0
|
20
28
|
|
21
29
|
- Improved HTTP/1 connection handling.
|
@@ -29,7 +37,7 @@ Please see the [project releases](https://socketry.github.io/async-http/releases
|
|
29
37
|
|
30
38
|
### v0.75.0
|
31
39
|
|
32
|
-
- Better handling of HTTP/1
|
40
|
+
- Better handling of HTTP/1 \<-\> HTTP/2 proxying, specifically upgrade/CONNECT requests.
|
33
41
|
|
34
42
|
### v0.74.0
|
35
43
|
|
data/releases.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Releases
|
2
2
|
|
3
|
+
## v0.82.0
|
4
|
+
|
5
|
+
- `protocol-http1` introduces a line length limit for request line, response line, header lines and chunk length lines.
|
6
|
+
|
7
|
+
## v0.81.0
|
8
|
+
|
9
|
+
- Expose `protocol` and `endpoint` as tags to `async-pool` for improved instrumentation.
|
10
|
+
|
3
11
|
## v0.77.0
|
4
12
|
|
5
13
|
- 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.
|
4
|
+
version: 0.82.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-
|
61
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
62
62
|
dependencies:
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: async
|
@@ -80,42 +80,42 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '0.
|
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.
|
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.
|
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.
|
104
|
+
version: '0.14'
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: io-stream
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0.
|
111
|
+
version: '0.6'
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '0.
|
118
|
+
version: '0.6'
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: protocol-http
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,16 +134,16 @@ dependencies:
|
|
134
134
|
name: protocol-http1
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - "
|
137
|
+
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
139
|
+
version: 0.28.1
|
140
140
|
type: :runtime
|
141
141
|
prerelease: false
|
142
142
|
version_requirements: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- - "
|
144
|
+
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
146
|
+
version: 0.28.1
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: protocol-http2
|
149
149
|
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
|