Class: Faraday::Adapter::HTTPX
Defined Under Namespace
Modules: OnDataPlugin, ReasonPlugin, RequestMixin
Classes: ParallelManager
Class Method Summary
collapse
Instance Method Summary
collapse
#build_connection, #close
Class Method Details
.setup_parallel_manager(options = {}) ⇒ Object
245
246
247
|
# File 'lib/httpx/adapters/faraday.rb', line 245
def setup_parallel_manager(options = {})
ParallelManager.new(options)
end
|
Instance Method Details
#call(env) ⇒ Object
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
# File 'lib/httpx/adapters/faraday.rb', line 250
def call(env)
super
if parallel?(env)
handler = env[:parallel_manager].enqueue(env)
handler.on_response do |response|
if response.is_a?(::HTTPX::Response)
save_response(env, response.status, response.body.to_s, response., response.reason) do ||
.merge!(response.)
end
else
env[:error] = response.error
save_response(env, 0, "", {}, nil)
end
end
return handler
end
response = connect_and_request(env)
save_response(env, response.status, response.body.to_s, response., response.reason) do ||
.merge!(response.)
end
@app.call(env)
end
|