class Faraday::Adapter::HTTPX

  1. lib/httpx/adapters/faraday.rb
Superclass: Adapter

Methods

Public Class

  1. setup_parallel_manager

Public Instance

  1. call

Included modules

  1. RequestMixin

Public Class methods

setup_parallel_manager(options = {})
[show source]
    # File lib/httpx/adapters/faraday.rb
243 def setup_parallel_manager(options = {})
244   ParallelManager.new(options)
245 end

Public Instance methods

call(env)
[show source]
    # File lib/httpx/adapters/faraday.rb
248 def call(env)
249   super
250   if parallel?(env)
251     handler = env[:parallel_manager].enqueue(env)
252     handler.on_response do |response|
253       if response.is_a?(::HTTPX::Response)
254         save_response(env, response.status, response.body.to_s, response.headers, response.reason) do |response_headers|
255           response_headers.merge!(response.headers)
256         end
257       else
258         env[:error] = response.error
259         save_response(env, 0, "", {}, nil)
260       end
261     end
262     return handler
263   end
264 
265   response = connect_and_request(env)
266   save_response(env, response.status, response.body.to_s, response.headers, response.reason) do |response_headers|
267     response_headers.merge!(response.headers)
268   end
269   @app.call(env)
270 end