close http2 connection as soon as it served all possible requests; this will make the persistent plugin account for resources better

This commit is contained in:
HoneyryderChuck 2020-03-07 22:57:08 +00:00
parent 4348f49c69
commit 745d95c7e0
2 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,7 @@ module HTTPX
end
def send(request)
if !@max_requests.positive?
unless @max_requests.positive?
@pending << request
return
end

View File

@ -202,6 +202,10 @@ module HTTPX
@streams.delete(request)
send(@pending.shift) unless @pending.empty?
return unless @streams.empty? && exhausted?
close
emit(:close)
end
def on_frame(bytes)