Open
Description
Hello,
I was working on configuring timeouts for faraday requests using typehous but noticed that for typehous adapter the timeout values are not adhered.
Example code:
require "bundler/inline"
gemfile do
source "https://rubygems.org"
ruby "2.7.6"
gem "faraday", "~> 1.7.0"
gem "typhoeus", "~> 1.4.0"
end
require "faraday"
require "typhoeus/adapters/faraday"
def net_http
p 'net_http'
conn = Faraday::Connection.new('https://httpstat.us')
conn.options.timeout = 1
conn.options.open_timeout = 20
conn.options
conn.adapter :net_http
p conn
# => #<Faraday::RequestOptions timeout=1, open_timeout=20>
conn.get('/200?sleep=800')
end
def typhoeus
p 'typehous'
conn = Faraday::Connection.new('https://httpstat.us')
conn.options.timeout = 1
conn.options.open_timeout = 20
conn.options
conn.adapter :typhoeus
p conn
# => #<Faraday::RequestOptions timeout=1, open_timeout=20>
conn.get('/200?sleep=800')
end
def handle
yield
rescue => e
p e.class
end
handle { typhoeus }
handle { net_http }
For the above code net_http adapter requests always succeed but all the typehous requests seem to be timing out.
The typheous request is only succeeding if the sleep time is set to something around 500 or below.
Metadata
Metadata
Assignees
Labels
No labels