Skip to content

Commit 80097b5

Browse files
committed
Update releases.
1 parent 7a6f689 commit 80097b5

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

changes.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
1-
# v0.18.0
1+
# Changes
22

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+
Async do
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
444

545
The `config_block` provided to the adapter must now return `nil`, `client` or a middleware wrapper around `client`.
646

@@ -16,9 +56,9 @@ Faraday.new do |builder|
1656
end
1757
```
1858

19-
# v0.17.0
59+
## v0.17.0
2060

21-
## Per-thread Client Cache
61+
### Per-thread Client Cache
2262

2363
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.
2464

readme.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Please see the [project documentation](https://socketry.github.io/async-http-far
1515

1616
## Releases
1717

18-
Please see the [project changes](https://socketry.github.io/async-http-faraday//changes/index) for all releases.
18+
Please see the [project changes](https://socketry.github.io/async-http-faraday/changes/index) for all releases.
19+
20+
### v0.19.0
21+
22+
- [Support `in_parallel`](https://socketry.github.io/async-http-faraday/changes/index#support-in_parallel)
1923

2024
### v0.18.0
2125

0 commit comments

Comments
 (0)