module HTTPX class Connection interface _Parser def on: (Symbol) { (*untyped) -> void } -> void def empty?: () -> bool # def exhausted?: () -> bool def close: () -> void def consume: () -> void def <<: (string) -> void # def send: (Request) -> void # def ping: () -> void # def timeout: () -> (Integer | Float) end extend Forwardable include Loggable include Callbacks attr_reader type: io_type attr_reader origin: URI::Generic attr_reader origins: Array[String] attr_reader state: Symbol attr_reader pending: Array[Request] attr_reader options: Options attr_writer timers: Timers attr_accessor family: Integer? @window_size: Integer @read_buffer: Buffer @write_buffer: Buffer @inflight: Integer @keep_alive_timeout: Numeric? @timeout: Numeric? @current_timeout: Numeric? @total_timeout: Numeric? @io: TCP | SSL | UNIX @parser: HTTP1 | HTTP2 | _Parser @connected_at: Float @response_received_at: Float def addresses: () -> Array[ipaddr]? def addresses=: (Array[ipaddr]) -> void def match?: (URI::Generic uri, Options options) -> bool def expired?: () -> boolish def mergeable?: (Connection) -> bool def coalescable?: (Connection) -> bool def create_idle: (?Hash[Symbol, untyped] options) -> Connection def merge: (Connection) -> void def purge_pending: () { (Request) -> void } -> void def match_altsvcs?: (URI::Generic uri) -> bool def match_altsvc_options?: (URI::Generic uri, Options options) -> bool def connecting?: () -> bool def inflight?: () -> boolish def interests: () -> io_interests? def to_io: () -> ::IO def call: () -> void def close: () -> void def reset: () -> void def send: (Request) -> void def timeout: () -> Numeric? def idling: () -> void def used?: () -> boolish def deactivate: () -> void def open?: () -> bool def raise_timeout_error: (Numeric interval) -> void private def initialize: (io_type, URI::Generic, options) -> untyped def connect: () -> void def exhausted?: () -> boolish def consume: () -> void def send_pending: () -> void def parser: () -> (HTTP1 | HTTP2 | _Parser) def send_request_to_parser: (Request request) -> void def build_parser: (?String protocol) -> (HTTP1 | HTTP2) def set_parser_callbacks: (HTTP1 | HTTP2 parser) -> void def transition: (Symbol) -> void def handle_transition: (Symbol) -> void def build_socket: (?Array[ipaddr]? addrs) -> (TCP | SSL | UNIX) def on_error: (HTTPX::TimeoutError | Error | StandardError) -> void def handle_error: (StandardError) -> void def purge_after_closed: () -> void def set_request_timeouts: (Request request) -> void def write_timeout_callback: (Request request, Numeric write_timeout) -> void def read_timeout_callback: (Request request, Numeric read_timeout, ?singleton(RequestTimeoutError) error_type) -> void def self.parser_type: (String protocol) -> (singleton(HTTP1) | singleton(HTTP2)) end end