mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
moving can_vuffer_more_requests? to private sector
it's only used internally
This commit is contained in:
parent
2b87a3d5e5
commit
c62966361e
@ -98,12 +98,6 @@ module HTTPX
|
||||
@connection << data
|
||||
end
|
||||
|
||||
def can_buffer_more_requests?
|
||||
(@handshake_completed || !@wait_for_handshake) &&
|
||||
@streams.size < @max_concurrent_requests &&
|
||||
@streams.size < @max_requests
|
||||
end
|
||||
|
||||
def send(request, head = false)
|
||||
unless can_buffer_more_requests?
|
||||
head ? @pending.unshift(request) : @pending << request
|
||||
@ -159,6 +153,12 @@ module HTTPX
|
||||
|
||||
private
|
||||
|
||||
def can_buffer_more_requests?
|
||||
(@handshake_completed || !@wait_for_handshake) &&
|
||||
@streams.size < @max_concurrent_requests &&
|
||||
@streams.size < @max_requests
|
||||
end
|
||||
|
||||
def send_pending
|
||||
while (request = @pending.shift)
|
||||
break unless send(request, true)
|
||||
|
@ -27,8 +27,6 @@ module HTTPX
|
||||
|
||||
def <<: (string) -> void
|
||||
|
||||
def can_buffer_more_requests?: () -> bool
|
||||
|
||||
def send: (Request request, ?bool head) -> bool
|
||||
|
||||
def consume: () -> void
|
||||
@ -45,6 +43,8 @@ module HTTPX
|
||||
|
||||
def initialize: (Buffer buffer, Options options) -> untyped
|
||||
|
||||
def can_buffer_more_requests?: () -> bool
|
||||
|
||||
def send_pending: () -> void
|
||||
|
||||
def set_protocol_headers: (Request) -> _Each[[String, String]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user