httpx/sig/pool.rbs
HoneyryderChuck 69e7e533de synchronize access to connections in the pool
also fixed the coalescing case where the connection may come from the pool, and should therefore be remmoved from there and selected/checked back in accordingly as a result
2024-11-19 12:55:44 +00:00

34 lines
954 B
Plaintext

module HTTPX
class Pool
type resolver_manager = Resolver::Multi | Resolver::System
@options: Options
@resolvers: Hash[Class, Array[resolver_manager]]
@resolver_mtx: Thread::Mutex
@connections: Array[Connection]
@connection_mtx: Thread::Mutex
def pop_connection: () -> Connection?
def checkout_connection: (http_uri uri, Options options) -> Connection
def checkin_connection: (Connection connection, ?boolish delete) -> 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: (Options options) -> void
def checkout_new_connection: (http_uri uri, Options options) -> Connection
def checkout_new_resolver: (Class resolver_type, Options options) -> resolver_manager
end
end