mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
emit and set the keep alive timeout to the channel, now that channels do their own accounting
This commit is contained in:
parent
648a0258ce
commit
02542d3c02
@ -297,6 +297,9 @@ module HTTPX
|
||||
transition(:open)
|
||||
end
|
||||
end
|
||||
parser.on(:timeout) do |timeout|
|
||||
@timeout = timeout
|
||||
end
|
||||
parser.on(:error) do |request, ex|
|
||||
case ex
|
||||
when MisdirectedRequestError
|
||||
|
@ -162,7 +162,10 @@ module HTTPX
|
||||
pair.split(/ *= */)
|
||||
end]
|
||||
@max_requests = parameters["max"].to_i if parameters.key?("max")
|
||||
@keep_alive_timeout = parameters["timeout"].to_i if parameters.key?("timeout")
|
||||
if parameters.key?("timeout")
|
||||
keep_alive_timeout = parameters["timeout"].to_i
|
||||
emit(:timeout, keep_alive_timeout)
|
||||
end
|
||||
# TODO: on keep alive timeout, reset
|
||||
when /close/i, nil
|
||||
disable_pipelining
|
||||
|
Loading…
x
Reference in New Issue
Block a user