mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-05 00:02:38 -04:00
50 lines
1.1 KiB
Plaintext
50 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]
|
|
@is_timer_interval: bool
|
|
|
|
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 |