drbrain / net-http-persistent

Thread-safe persistent connections with Net::HTTP
http://seattlerb.rubyforge.org/net-http-persistent
339 stars 117 forks source link

Set connection.keep_alive_timeout using idle_timeout in ruby 2.0. #53

Closed dylanahsmith closed 10 years ago

dylanahsmith commented 10 years ago

Fixes issue #39

Problem

Ruby 2.0 added keep_alive_timeout, which behaves the same way as idle_timeout, except that the default timeout is 5 seconds rather than 2 seconds. This means that the default timeout is effectively 2 seconds, and idle_timeout isn't respected when it is greater than 2 seconds.

Solution

Set keep_alive_timeout on the connection using idle_timeout on ruby 2.0.

joankaradimov commented 10 years ago

:+1:

bbatsov commented 10 years ago

:+1:

alexbhr commented 10 years ago

:+1: for merging this indeed!