Faraday::Adapter::Typhoeus

Adapter to use Faraday with Typhoeus.

@example Use Typhoeus.

require 'faraday'
require 'typhoeus'
require 'typhoeus/adapters/faraday'

conn = Faraday.new(url: "www.example.com") do |faraday|
  faraday.adapter :typhoeus
end

response = conn.get("/")

Public Class Methods

setup_parallel_manager(options = {}) click to toggle source

Setup Hydra with provided options.

@example Setup Hydra.

Faraday::Adapter::Typhoeus.setup_parallel_manager
#=> #<Typhoeus::Hydra ... >

@param (see Typhoeus::Hydra#initialize) @option (see Typhoeus::Hydra#initialize)

@return [ Typhoeus::Hydra ] The hydra.

# File lib/typhoeus/adapters/faraday.rb, line 45
def self.setup_parallel_manager(options = {})
  ::Typhoeus::Hydra.new(options)
end

Public Instance Methods

call(env) click to toggle source

Hook into Faraday and perform the request with Typhoeus.

@param [ Hash ] env The environment.

@return [ void ]

# File lib/typhoeus/adapters/faraday.rb, line 56
def call(env)
  super
  perform_request env
  @app.call env
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.