Skip to content

Parallel requests

mislav edited this page Jan 15, 2012 · 5 revisions

Making parallel HTTP requests

Simple parallelism

Note about picking the right adapter.

conn.in_parallel do
  resp1 = conn.get('/one')
  resp2 = conn.get('/two')
end

Note about at which point response bodies are available.

Advanced use

Using the manager directly.

conn.in_parallel(manager) do ...

Explicitly setting the default parallel manager

conn = Faraday.new :parallel_manager => manager

Clone this wiki locally