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: http_uri attr_reader origins: Array[String] attr_reader state: Symbol attr_reader pending: Array[Request] attr_reader options: Options attr_reader ssl_session: OpenSSL::SSL::Session? 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? @io: TCP | SSL | UNIX @parser: Object & _Parser @connected_at: Float @response_received_at: Float @intervals: Array[Timers::Interval] def addresses: () -> Array[ipaddr]? def addresses=: (Array[ipaddr] addresses) -> void def send: (Request request) -> void def match?: (URI::Generic uri, Options options) -> bool def expired?: () -> boolish def mergeable?: (Connection connection) -> bool def coalescable?: (Connection connection) -> bool def create_idle: (?Hash[Symbol, untyped] options) -> Connection def merge: (Connection connection) -> void def purge_pending: () { (Request request) -> void } -> void def connecting?: () -> bool def inflight?: () -> boolish def interests: () -> io_interests? def to_io: () -> ::IO def call: () -> void def terminate: () -> void def close: () -> void def reset: () -> void def timeout: () -> Numeric? def idling: () -> void def used?: () -> boolish def deactivate: () -> void def open?: () -> bool def handle_socket_timeout: (Numeric interval) -> void private def initialize: (http_uri uri, Options options) -> void def initialize_type: (http_uri uri, Options options) -> io_type def connect: () -> void def exhausted?: () -> boolish def consume: () -> void def send_pending: () -> void def parser: () -> (Object & _Parser) def send_request_to_parser: (Request request) -> void def build_parser: (?String protocol) -> (Object & _Parser) def set_parser_callbacks: (HTTP1 | HTTP2 parser) -> void def transition: (Symbol nextstate) -> void def handle_transition: (Symbol nextstate) -> void def build_socket: (?Array[ipaddr]? addrs) -> (TCP | SSL | UNIX) def on_error: (HTTPX::TimeoutError | Error | StandardError error, ?Request? request) -> void def handle_error: (StandardError error, ?Request? request) -> void def purge_after_closed: () -> void def set_request_timeouts: (Request request) -> void def set_request_read_timeout: (Request request) -> void def set_request_write_timeout: (Request request) -> void def set_request_request_timeout: (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 set_request_timeout: (Request request, Numeric timeout, Symbol start_event, Symbol | Array[Symbol] finish_events) { () -> void } -> void def self.parser_type: (String protocol) -> (singleton(HTTP1) | singleton(HTTP2)) end end