reqivo.transport packageΒΆ
SubmodulesΒΆ
reqivo.transport.connection moduleΒΆ
src/reqivo/transport/connection.py
TCP and TLS connection management module.
This module provides low-level connection handling with support for TLS encryption, proxy connections, and proper error handling for network operations.
- class reqivo.transport.connection.Connection(host: str, port: int, use_ssl: bool = False, timeout: float | Timeout | None = None)[source]ΒΆ
Bases:
objectManages TCP and TLS connection creation and lifecycle.
- hostΒΆ
The target hostname or IP address.
- portΒΆ
The target port number.
- use_sslΒΆ
Whether to use TLS encryption.
- timeoutΒΆ
Connection timeout configuration.
- sockΒΆ
The underlying socket object.
reqivo.transport.connection_pool moduleΒΆ
src/reqivo/transport/connection_pool.py
Connection pooling module.
This module provides connection pool management for efficient reuse of TCP/TLS connections across multiple HTTP requests.
- class reqivo.transport.connection_pool.ConnectionPool(max_size: int = 10, max_idle_time: float = 30.0)[source]ΒΆ
Bases:
objectPool of reusable open connections.
Maintains a cache of open connections keyed by (host, port, ssl, proxy) to enable connection reuse across multiple requests.
This implementation is thread-safe and supports multiple connections per host.
- get_connection(host: str, port: int, use_ssl: bool, timeout: float | Timeout | None = None) Connection[source]ΒΆ
Get an existing connection or create a new one. Blocks if max_size is reached until a connection is available.
- put_connection(conn: Connection) None[source]ΒΆ
Return a connection to the pool with timestamp.
- discard_connection(conn: Connection) None[source]ΒΆ
Discard a connection and release its slot.
- class reqivo.transport.connection_pool.AsyncConnectionPool(max_size: int = 10, max_idle_time: float = 30.0)[source]ΒΆ
Bases:
objectPool of reusable asynchronous connections.
- async get_connection(host: str, port: int, use_ssl: bool, timeout: float | Timeout | None = None) AsyncConnection[source]ΒΆ
Returns an existing connection or creates a new one.
- async put_connection(conn: AsyncConnection) None[source]ΒΆ
Returns a connection to the pool for reuse with timestamp.
- async discard_connection(conn: AsyncConnection) None[source]ΒΆ
Discard async connection and release slot.
reqivo.transport.selectors moduleΒΆ
src/reqivo/transport/selectors.py
Helpers for networking selectors and async/non-blocking operations.
reqivo.transport.tls moduleΒΆ
src/reqivo/transport/tls.py
Advanced TLS configuration for Reqivo.
- reqivo.transport.tls.create_ssl_context() SSLContext[source]ΒΆ
Creates a default SSL context with TLS 1.2 minimum.