async-http-faraday 0.13.0 → 0.14.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/faraday/adapter.rb +6 -3
- data/lib/async/http/faraday/version.rb +1 -1
- data/readme.md +3 -3
- data.tar.gz.sig +0 -0
- metadata +6 -4
- 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: c8efd253e7a697bce2dbe8aafcab6cc667584242e923ee060213ee88ba40a2ce
|
4
|
+
data.tar.gz: 34c1d934c5e153091a04e5208144026d5da10e6dd429c67a0770a3f25b71ecdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d921cee566700dc9c82bbf9f993f20c8f912523ed75b78d7f644c0e962fce63203f38648867ebc74b600713d1240db7909d69f0199ac56e3dcef90942ac855e
|
7
|
+
data.tar.gz: 8a7746559ec23c868445ae1d18201d6ac00c38ef1c950d0401d14cf62c4852c4861ad852d5bc9fe7044840b7db659ff63ef7088354fded353014f1641d04bdad
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -18,7 +18,7 @@ require 'async/http/proxy'
|
|
18
18
|
module Async
|
19
19
|
module HTTP
|
20
20
|
module Faraday
|
21
|
-
class
|
21
|
+
class BodyReadWrapper < ::Protocol::HTTP::Body::Readable
|
22
22
|
def initialize(body, block_size: 4096)
|
23
23
|
@body = body
|
24
24
|
@block_size = block_size
|
@@ -118,8 +118,11 @@ module Async
|
|
118
118
|
if body = env.body
|
119
119
|
# We need to wrap the body in a Readable object so that it can be read in chunks:
|
120
120
|
# Faraday's body only responds to `#read`.
|
121
|
-
|
122
|
-
|
121
|
+
if body.respond_to?(:read)
|
122
|
+
body = BodyReadWrapper.new(body)
|
123
|
+
else
|
124
|
+
body = ::Protocol::HTTP::Body::Buffered.wrap(body)
|
125
|
+
end
|
123
126
|
end
|
124
127
|
|
125
128
|
if headers = env.request_headers
|
data/readme.md
CHANGED
@@ -31,8 +31,8 @@ require 'async/http/faraday'
|
|
31
31
|
Faraday.default_adapter = :async_http
|
32
32
|
|
33
33
|
# Per connection:
|
34
|
-
|
35
|
-
|
34
|
+
connection = Faraday.new(...) do |builder|
|
35
|
+
builder.adapter :async_http
|
36
36
|
end
|
37
37
|
```
|
38
38
|
|
@@ -40,7 +40,7 @@ Here is how you make a request:
|
|
40
40
|
|
41
41
|
``` ruby
|
42
42
|
Async do
|
43
|
-
response =
|
43
|
+
response = connection.get("/index")
|
44
44
|
end
|
45
45
|
```
|
46
46
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http-faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -44,7 +44,7 @@ cert_chain:
|
|
44
44
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
45
45
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date: 2024-
|
47
|
+
date: 2024-04-23 00:00:00.000000000 Z
|
48
48
|
dependencies:
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: async-http
|
@@ -90,7 +90,9 @@ files:
|
|
90
90
|
homepage: https://github.com/socketry/async-http
|
91
91
|
licenses:
|
92
92
|
- MIT
|
93
|
-
metadata:
|
93
|
+
metadata:
|
94
|
+
documentation_uri: https://socketry.github.io/async-http/
|
95
|
+
source_code_uri: https://github.com/socketry/async-http.git
|
94
96
|
post_install_message:
|
95
97
|
rdoc_options: []
|
96
98
|
require_paths:
|
@@ -99,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
101
|
requirements:
|
100
102
|
- - ">="
|
101
103
|
- !ruby/object:Gem::Version
|
102
|
-
version: '3.
|
104
|
+
version: '3.1'
|
103
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
106
|
requirements:
|
105
107
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|