mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-05 00:02:38 -04:00
since pools can keep multiple persistent connections which may have been terminated by the peer already, exhausting the one retry attempt from the persistent plugin may make request fail before trying it on an actual connection. in this patch, requests which are preceded by a PING frame used for probing are therefore marked as such, and do not decrement the attempts counter when failing
84 lines
1.7 KiB
Plaintext
84 lines
1.7 KiB
Plaintext
module HTTPX
|
|
class Request
|
|
extend Forwardable
|
|
include Callbacks
|
|
|
|
METHODS: Array[Symbol]
|
|
USER_AGENT: String
|
|
|
|
attr_reader verb: verb
|
|
attr_reader uri: http_uri
|
|
attr_reader headers: Headers
|
|
attr_reader body: Body
|
|
attr_reader state: Symbol
|
|
attr_reader options: Options
|
|
attr_reader response: response?
|
|
attr_reader drain_error: StandardError?
|
|
attr_reader active_timeouts: Array[Symbol]
|
|
|
|
attr_accessor peer_address: ipaddr?
|
|
|
|
attr_writer persistent: bool
|
|
|
|
@ping: bool
|
|
@query_params: Hash[interned, untyped]?
|
|
@trailers: Headers?
|
|
@informational_status: Integer?
|
|
@query: String?
|
|
@drainer: Enumerator[String, void]?
|
|
|
|
def initialize: (Symbol | String verb, generic_uri uri, Options options, ?request_params params) -> untyped
|
|
|
|
def ping?: () -> bool
|
|
|
|
def ping!: () -> void
|
|
|
|
def empty?: () -> bool
|
|
|
|
def close: () -> void
|
|
|
|
def interests: () -> (:r | :w)
|
|
|
|
def merge_headers: (_Each[[String, headers_value]]) -> void
|
|
|
|
def scheme: () -> String
|
|
|
|
def response=: (response) -> void
|
|
|
|
def path: () -> String
|
|
|
|
def authority: () -> String
|
|
|
|
def origin: () -> String
|
|
|
|
def query: () -> String
|
|
|
|
def drain_body: () -> String?
|
|
|
|
def inspect: () -> String
|
|
|
|
def transition: (Symbol) -> void
|
|
|
|
def expects?: () -> boolish
|
|
|
|
def trailers: () -> Headers
|
|
|
|
def trailers?: () -> boolish
|
|
|
|
def persistent?: () -> bool
|
|
|
|
def read_timeout: () -> Numeric?
|
|
|
|
def write_timeout: () -> Numeric?
|
|
|
|
def request_timeout: () -> Numeric?
|
|
|
|
def set_timeout_callback: (Symbol event) { (*untyped) -> void } -> void
|
|
|
|
private
|
|
|
|
def initialize_body: (Options options) -> Transcoder::_Encoder?
|
|
|
|
end
|
|
end
|