httpx/sig/connection.rbs

171 lines
4.3 KiB
Plaintext

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 io: TCP | SSL | UNIX | nil
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_reader sibling: instance?
attr_writer current_selector: Selector?
attr_accessor current_session: Session?
attr_accessor family: Integer?
@window_size: Integer
@read_buffer: Buffer
@write_buffer: Buffer
@inflight: Integer
@keep_alive_timeout: Numeric?
@timeout: Numeric?
@current_timeout: Numeric?
@parser: Object & _Parser
@connected_at: Float
@response_received_at: Float
@exhausted: bool
@cloned: bool
@coalesced_connection: instance?
@sibling: instance?
@main_sibling: bool
def addresses: () -> Array[Resolver::Entry]?
def peer: () -> URI::Generic
def addresses=: (Array[Resolver::Entry] addresses) -> void
def send: (Request request) -> void
def addresses?: () -> boolish
def match?: (URI::Generic uri, Options options) -> bool
def expired?: () -> boolish
def mergeable?: (Connection connection) -> bool
def coalesce!: (instance connection) -> void
def coalescable?: (Connection connection) -> bool
def create_idle: (?Hash[Symbol, untyped] options) -> instance
def merge: (Connection connection) -> void
def purge_pending: () { (Request request) -> void } -> void
def connecting?: () -> bool
def io_connected?: () -> bool
def inflight?: () -> boolish
def interests: () -> io_interests?
def to_io: () -> IO
def call: () -> void
def terminate: () -> void
def close: () -> void
def force_reset: (?bool cloned) -> 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
def sibling=: (instance? connection) -> void
def handle_connect_error: (StandardError error) -> void
def disconnect: () -> 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_altsvc_connection: (URI::Generic alt_origin, String origin, Hash[String, String] alt_params) -> void
def build_socket: (?Array[Resolver::Entry]? addrs) -> (TCP | SSL | UNIX)
def on_error: (HTTPX::TimeoutError | Error | StandardError error, ?Request? request) -> void
def handle_error: (StandardError error, ?Request? request) -> void
def close_sibling: () -> 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: (Symbol label, Request request, Numeric timeout, Symbol start_event, Symbol | Array[Symbol] finish_events) { () -> void } -> void
def parser_type: (String protocol) -> (singleton(HTTP1) | singleton(HTTP2))
end
end