-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
Sorry to use GitHub issues for a question (happy to turn this into a documentation PR if applicable!), but I'm struggling to understand the difference between using this adapter with Faraday, vs using "plain" https://github.com/socketry/async with Faraday.
The in_parallel documentation shows the following example:
Async do
response1 = Async{adapter.get("/index")}
response2 = Async{adapter.get("/index")}
response3 = Async{adapter.get("/index")}
puts response1.wait.body # => "Hello World"
puts response2.wait.body # => "Hello World"
puts response3.wait.body # => "Hello World"
endI'm having trouble understanding how this relates to the faraday adapter and what the difference is from using just https://github.com/socketry/async?
Put differently, what is the difference between these three examples?
1. Set default_adapter to async_http
Faraday.default_adapter = :async_http
response1 = adapter.get("/index")
response2 = adapter.get("/index")
puts response1.body
puts response2.body2. Set default_adapter to async_http + use Async block
Faraday.default_adapter = :async_http
Async do
response1 = Async{adapter.get("/index")}
response2 = Async{adapter.get("/index")}
puts response1.wait.body
puts response2.wait.body
end3. Use regular default_adapter + use Async block
Async do
response1 = Async{adapter.get("/index")}
response2 = Async{adapter.get("/index")}
puts response1.wait.body
puts response2.wait.body
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels