httpx/sig/pool.rbs
2025-03-19 23:30:36 +00:00

47 lines
1.3 KiB
Plaintext

module HTTPX
type pool_options = {
max_connections_per_origin: Integer?,
pool_timeout: Numeric?
}
class Pool
POOL_TIMEOUT: Integer
type resolver_manager = Resolver::Multi | Resolver::System
@max_connections_per_origin: Integer
@pool_timeout: Numeric
@options: Options
@resolvers: Hash[Class, Array[resolver_manager]]
@resolver_mtx: Thread::Mutex
@connections: Hash[String, Array[Connection]]
@connection_mtx: Thread::Mutex
@origin_counters: Hash[String, Integer]
@origin_conds: Hash[String, ConditionVariable]
def pop_connection: () -> Connection?
def checkout_connection: (http_uri uri, Options options) -> Connection
def checkin_connection: (Connection connection) -> void
def checkout_mergeable_connection: (Connection connection) -> Connection?
def reset_resolvers: () -> void
def checkout_resolver: (Options options) -> resolver_manager
def checkin_resolver: (Resolver::Resolver resolver) -> void
private
def initialize: (pool_options options) -> void
def acquire_connection: (http_uri uri, Options options) -> Connection?
def checkout_new_connection: (http_uri uri, Options options) -> Connection
def checkout_new_resolver: (Class resolver_type, Options options) -> resolver_manager
end
end