← Về thư mục
openai4s/http_deadline.py
- HTTPExchangeTimeout · class · L31-L32 — class HTTPExchangeTimeout(TimeoutError)
- _socket_retired · function · L35-L57 — def _socket_retired(sock: Any) -> bool
- _arm_read_timeout · function · L60-L84 — def _arm_read_timeout(sock: Any, value: float) -> None
- _walk_response_transports · function · L87-L112 — def _walk_response_transports(response: Any) -> Iterator[Any]
- socket_timeout_setter · function · L115-L129 — def socket_timeout_setter(response: Any) -> Callable[[float], Any] | None
- _remaining_body_bytes · function · L132-L144 — def _remaining_body_bytes(response: Any) -> int | None
- _body_exhausted_probe · function · L147-L169 — def _body_exhausted_probe(response: Any) -> Callable[[], bool]
- exhausted · function · L160-L167 — def exhausted() -> bool
- response_body_exhausted · function · L172-L186 — def response_body_exhausted(response: Any) -> bool
- read_body_capped · function · L189-L297 — def read_body_capped( response: Any, *, limit: int, exchange: HTTPExchangeDeadline, on_timeout: Callable[[], BaseException], on_oversize: Callable[[], BaseException], on_truncated: Callable[[], BaseException], on_unbounded: Callable[[], BaseException] | None = None, ) -> bytes
- raise_truncated_or_timeout · function · L254-L257 — def raise_truncated_or_timeout() -> None
- _response_socket · function · L300-L310 — def _response_socket(response: Any) -> socket.socket | None
- _close_socket · function · L313-L323 — def _close_socket(sock: Any) -> None
- HTTPExchangeDeadline · class · L326-L595 — class HTTPExchangeDeadline
- init · method · L335-L343 — def init(self, timeout: float) -> None
- expired · method · L346-L348 — def expired(self) -> bool
- enter · method · L350-L361 — def enter(self) -> HTTPExchangeDeadline
- exit · method · L363-L377 — def exit(self, exc_type, exc, traceback) -> bool: # noqa: ANN001
- _expire · method · L379-L387 — def _expire(self) -> None
- cancel · method · L389-L401 — def cancel(self) -> None
- remaining · method · L403-L416 — def remaining(self) -> float
- _register_socket · method · L418-L427 — def _register_socket(self, sock: socket.socket) -> None
- _unregister_socket · method · L429-L432 — def _unregister_socket(self, sock: socket.socket) -> None
- create_connection · method · L434-L481 — def create_connection( self, address: tuple[str, int], timeout: Any = None, source_address: tuple[str, int] | None = None, ) -> socket.socket
- wrap_tls · method · L483-L520 — def wrap_tls( self, raw_socket: socket.socket, context: Any, *, server_hostname: str, ) -> socket.socket
- register_response · method · L522-L537 — def register_response(self, response: Any) -> None
- http_handler · method · L539-L546 — def http_handler( self, connection_class: type[http.client.HTTPConnection] | None = None, ) -> urllib.request.HTTPHandler
- https_handler · method · L548-L555 — def https_handler( self, connection_class: type[http.client.HTTPSConnection] | None = None, ) -> urllib.request.HTTPSHandler
- build_opener · method · L557-L564 — def build_opener(self, *handlers: Any) -> urllib.request.OpenerDirector
- open · method · L566-L595 — def open(self, opener: Any, request: urllib.request.Request) -> Any
- _DeadlineHTTPConnection · class · L598-L608 — class _DeadlineHTTPConnection(http.client.HTTPConnection)
- init · method · L599-L602 — def init(self, args: Any, deadline: HTTPExchangeDeadline, *kwargs: Any)
- connect · method · L604-L608 — def connect(self) -> None
- _DeadlineHTTPSConnection · class · L611-L630 — class _DeadlineHTTPSConnection(http.client.HTTPSConnection)
- init · method · L612-L615 — def init(self, args: Any, deadline: HTTPExchangeDeadline, *kwargs: Any)
- connect · method · L617-L630 — def connect(self) -> None: # Calling the HTTP base performs TCP connect and an optional proxy # CONNECT tunnel through our registered socket. TLS is deliberately # split into wrap + handshake so the SSLSocket is registered before # the blocking handshake begins.
- _DeadlineHTTPHandler · class · L633-L649 — class _DeadlineHTTPHandler(urllib.request.HTTPHandler)
- init · method · L634-L642 — def init( self, deadline: HTTPExchangeDeadline, *, connection_class: type[http.client.HTTPConnection], ) -> None
- http_open · method · L644-L649 — def http_open(self, request: urllib.request.Request) -> Any
- _DeadlineHTTPSHandler · class · L652-L674 — class _DeadlineHTTPSHandler(urllib.request.HTTPSHandler)
- init · method · L653-L661 — def init( self, deadline: HTTPExchangeDeadline, *, connection_class: type[http.client.HTTPSConnection], ) -> None
- https_open · method · L663-L674 — def https_open(self, request: urllib.request.Request) -> Any