Class Faraday::Adapter::Typhoeus
In: lib/typhoeus/adapters/faraday.rb
Parent: Faraday::Adapter

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

    # You can include Typhoeus options to be used for every request
    # faraday.adapter :typhoeus, forbid_reuse: true, maxredirs: 1
  end

  response = conn.get("/")

Methods

Public Class methods

Initialize the Typhoeus adapter

@param [ App ] app Farday app @option [ Hash ] adapter_options Typhoeus options

@return [ void ]

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.

Public Instance methods

Hook into Faraday and perform the request with Typhoeus.

@param [ Hash ] env The environment.

@return [ void ]

[Validate]