lib/persistent_http.rb in persistent_http-1.0.3 vs lib/persistent_http.rb in persistent_http-1.0.4
- old
+ new
@@ -104,10 +104,13 @@
# A name for this connection. Allows you to keep your connections apart
# from everybody else's.
attr_reader :name
##
+ # Seconds to wait for an available connection before a Timeout::Error is raised
+ attr_accessor :pool_timeout
+ ##
# Seconds to wait until a connection is opened. See Net::HTTP#open_timeout
attr_accessor :open_timeout
##
# The maximum size of the connection pool
@@ -176,10 +179,11 @@
@headers = options[:header] || {}
@host = options[:host]
@idle_timeout = options[:idle_timeout] || 10
@keep_alive = options[:keep_alive] || 30
@logger = options[:logger]
+ @pool_timeout = options[:pool_timeout]
@open_timeout = options[:open_timeout]
@pool_size = options[:pool_size] || 1
@port = options[:port]
@private_key = options[:private_key]
@read_timeout = options[:read_timeout]
@@ -229,9 +233,10 @@
net_http_args.concat @proxy_args
end
@pool = GenePool.new(:name => name + '-' + connection_id,
:pool_size => @pool_size,
+ :timeout => @pool_timeout,
:warn_timeout => @warn_timeout,
:idle_timeout => @idle_timeout,
:close_proc => nil,
:logger => @logger) do
begin