httpx/sig/selector.rbs
HoneyryderChuck 11d197ff24 changed internal session structure, so that it uses local selectors directly
pools are then used only to fetch new conenctions; selectors are discarded when not needed anymore; HTTPX.wrap is for now patched, but would ideally be done with in the future
2024-11-19 12:55:44 +00:00

49 lines
1.1 KiB
Plaintext

module HTTPX
type selectable = Connection | Resolver::Native
class Selector
include _Each[selectable]
READABLE: Array[Symbol]
WRITABLE: Array[Symbol]
@timers: Timers
@selectables: Array[selectable]
def next_tick: () -> void
def terminate: () -> void
def find_resolver: (Options options) -> Resolver::Resolver?
def find_connection: (http_uri request_uri, Options options) -> Connection?
def each_connection: () { (Connection) -> void} -> void
| () -> Enumerable[Connection]
def find_mergeable_connection: (Connection connection) -> Connection?
def empty?: () -> bool
def register: (selectable io) -> void
def deregister: (selectable io) -> selectable?
private
def initialize: () -> void
def select: (Numeric? interval) { (selectable) -> void } -> void
def select_many: (Numeric? interval) { (selectable) -> void } -> void
def select_one: (Numeric? interval) { (selectable) -> void } -> void
def next_timeout: () -> Numeric?
def emit_error: (StandardError e) -> void
end
type io_interests = :r | :w | :rw
end