Class: Faraday::Adapter::Typhoeus
- Inherits:
-
Faraday::Adapter
- Object
- Faraday::Adapter
- Faraday::Adapter::Typhoeus
- Defined in:
- lib/faraday/adapter/typhoeus.rb
Class Method Summary collapse
-
.setup_parallel_manager(options = {}) ⇒ Typhoeus::Hydra
Setup Hydra with provided options.
Instance Method Summary collapse
Class Method Details
.setup_parallel_manager(options = {}) ⇒ Typhoeus::Hydra
Setup Hydra with provided options.
21 22 23 |
# File 'lib/faraday/adapter/typhoeus.rb', line 21 def self.setup_parallel_manager( = {}) ::Typhoeus::Hydra.new() end |
Instance Method Details
#call(env) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/faraday/adapter/typhoeus.rb', line 26 def call(env) super perform_request env @app.call(env) # Finally, it's good practice to rescue client-specific exceptions (e.g. # Timeout, ConnectionFailed, etc...) and re-raise them as Faraday # Errors. Check `Faraday::Error` for a list of all errors. # # rescue MyAdapterTimeout => e # # Most errors allow you to provide the original exception and optionally (if available) the response, to # # make them available outside of the middleware stack. # raise Faraday::TimeoutError, e # end end |