httpx/sig/selector.rbs
HoneyryderChuck ecab7951c9 bugfix for unregistering connections timing out while resolving
A subtle bug slipped through the cracks, where if a resolve timeout
error happened, the connection would remain in the pool. Subsequent
requests to the same domain would activate it, although no requests
would go through it; the actual desired behaviour is to outright remove
it from the pool on such errors.

This was achieved by registering the "unregister_connection" callback
earlier. However, the connection accounting step would only trigger if
taking it out of the selector worked, meaning it had been registered
before.
2022-06-21 02:20:32 +03:00

23 lines
600 B
Plaintext

module HTTPX
class Selector
type selectable = Connection | Resolver::Native | Resolver::System
READABLE: Array[Symbol]
WRITABLE: Array[Symbol]
@selectables: Array[selectable]
def register: (selectable io) -> void
def deregister: (selectable io) -> selectable?
def select: (Numeric? interval) { (selectable) -> void } -> void
private
def initialize: () -> untyped
def select_many: (Numeric? interval) { (selectable) -> void } -> void
def select_one: (Numeric? interval) { (selectable) -> void } -> void
end
type io_interests = :r | :w | :rw
end