You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changes.md
+44-4
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,46 @@
1
-
# v0.18.0
1
+
# Changes
2
2
3
-
## Config Block
3
+
## v0.19.0
4
+
5
+
### Support `in_parallel`
6
+
7
+
The adapter now supports the `in_parallel` method, which allows multiple requests to be made concurrently.
8
+
9
+
```ruby
10
+
adapter =Faraday.new(bound_url) do |builder|
11
+
builder.adapter :async_http
12
+
end
13
+
14
+
response1 = response2 = response3 =nil
15
+
16
+
adapter.in_parallel do
17
+
response1 = adapter.get("/index")
18
+
response2 = adapter.get("/index")
19
+
response3 = adapter.get("/index")
20
+
end
21
+
22
+
puts response1.body # => "Hello World"
23
+
puts response2.body # => "Hello World"
24
+
puts response3.body # => "Hello World"
25
+
```
26
+
27
+
This is primarily for compatibility with existing code. If you are designing a new library, you should just use `Async` directly:
28
+
29
+
```ruby
30
+
Asyncdo
31
+
response1 =Async{adapter.get("/index")}
32
+
response2 =Async{adapter.get("/index")}
33
+
response3 =Async{adapter.get("/index")}
34
+
35
+
puts response1.wait.body # => "Hello World"
36
+
puts response2.wait.body # => "Hello World"
37
+
puts response3.wait.body # => "Hello World"
38
+
end
39
+
```
40
+
41
+
## v0.18.0
42
+
43
+
### Config Block
4
44
5
45
The `config_block` provided to the adapter must now return `nil`, `client` or a middleware wrapper around `client`.
6
46
@@ -16,9 +56,9 @@ Faraday.new do |builder|
16
56
end
17
57
```
18
58
19
-
# v0.17.0
59
+
##v0.17.0
20
60
21
-
## Per-thread Client Cache
61
+
###Per-thread Client Cache
22
62
23
63
The default adapter now uses a per-thread client cache internally, to improve compatibility with existing code that shares a single `Faraday::Connection` instance across multiple threads.
0 commit comments