httpx/sig/httpx.rbs
HoneyryderChuck 2940323412 implemented happy eyeballs v2 (rfc8305) for native and https resolver
Two resolver are kept (IPv6/IPv4) along in the pool, to which all
names are sent to and read from in the same pool. IPv4 resolves are
subject to a 50ms delay (as per rfc) before they're used for connecting.
IPv6 addresses have preference, in that if they arrive before the delay,
they are immediately used. If they arrive after the delay, they do not
interrupt the connection, but they'll be the next-in-line in case
connection handshake fails.

Two resolvers are kept, but the inherent Connection will be shared,
thereby sending name resolving requests to the same HTTP/2 connection in
bulk. The resolution delay logic from above also applies.

Currently handles resolving via `resolv` lib. This happens synchronously
though, so we're not there yet.
2022-01-16 22:54:56 +02:00

22 lines
589 B
Plaintext

module HTTPX
extend Chainable
EMPTY: Array[untyped]
VERSION: String
type uri = URI::HTTP | URI::HTTPS | string
type generic_uri = String | URI::Generic
type verb = :options | :get | :head | :post | :put | :delete | :trace | :connect |
:propfind | :proppatch | :mkcol | :copy | :move | :lock | :unlock | :orderpatch |
:acl | :report | :patch | :search
type ip_family = Integer #Socket::AF_INET6 | Socket::AF_INET
module Plugins
def self?.load_plugin: (Symbol) -> Module
def self?.register_plugin: (Symbol, Module) -> void
end
end