Packages
Modules
Allow running pounce via python -m pounce.
Command-line interface for pounce.
Content encoding negotiation and compressor factory. Parses Accept-Encoding headers, selects the best encoding, and...
CPU affinity for worker threads (Linux only).
Development error pages with rich tracebacks.
Error hierarchy for pounce. All pounce errors inherit from PounceError.
Fast HTTP/1.1 parser for the sync worker — replaces h11 on the hot path.
HTTP/2 connection handler — manages multiplexed streams over a single connection. Extracted from ``worker.py`` to...
HTTP/3 connection handler — manages QUIC/UDP streams via zoomies. HTTP/3 uses QUIC (UDP) transport.
Shared header lookup utilities. Single-pass header extraction for ASGI headers (list or tuple of (name, value) byte...
Built-in health check endpoint. Responds to GET requests at the configured ``health_check_path`` before the request...
Hot reload without connection drops for pounce.
Application importer — resolves string references to ASGI callables.
Built-in /metrics endpoint for Prometheus scraping.
Middleware extension system for server-level request/response processing.
OpenTelemetry integration for distributed tracing.
Kida template infrastructure and one-shot branded output. Provides the shared template environment, thread-safe...
HTTP Priority Signals (RFC 9218). Parses the ``Priority`` header (``u=N, i``) from HTTP/2 requests and provides a...
Request profiling — enabled via POUNCE_PROFILE=1. Samples every Nth request and logs read/parse/app/drain timings...
Proxy header validation — extract real client info from trusted reverse proxies. When ``trusted_hosts`` is...
Rate limiting and backpressure for pounce.
File watcher for development mode (``--reload``). Polls the application's source directory for changes and signals...
Request ID generation and propagation. Each request gets a unique ID for tracing across logs and services. If a...
Shared request pipeline — functions used by both Worker and SyncWorker.
Request queuing and load shedding for pounce.
Pre-built HTTP response framing for the fused sync path. Bypasses H1Protocol/h11 for the hot path — serializes...
Runtime detection utilities. Detects GIL state and determines the appropriate worker mode for the current Python...
Sentry error tracking integration for pounce.
Server lifecycle state machine — Elm Architecture via milo. Centralizes the server lifecycle (init → startup →...
Static file serving with modern optimizations. Designed for Bengal SSG output and Chirp static assets.
Timing utilities and Server-Timing header builder. Provides monotonic clock helpers for request-level timing and a...
ASGI type definitions for pounce. Typed definitions for the ASGI 3.0 protocol.
WebSocket connection handler — HTTP/1.1 upgrade lifecycle. Extracted from ``worker.py`` to keep protocol-specific...
AcceptDistributor — single-thread accept feeding a shared worker queue. Eliminates thundering herd on macOS/Windows...
AsyncPool — dedicated event loop for streaming and WebSocket connections. Receives handoffs from SyncWorkers when...
Server configuration.
HTTP/3 worker — runs QUIC/UDP datagram endpoint for HTTP/3.
Connection lifecycle events — structured, immutable records. Each event captures a moment in a connection's...
Logging configuration and access log formatting. Configures stdlib logging with pounce-specific formatting.
Prometheus-compatible metrics collector. Implements the ``LifecycleCollector`` protocol to track standard...
Pounce — A free-threading-native ASGI server for Python 3.14t. Pounce is a pure-Python ASGI server designed from...
Server — orchestrates the full pounce lifecycle. Manages the state machine: CONFIG → DETECT → BIND → LIFESPAN →...
Supervisor — spawns, monitors, and restarts workers. The supervisor sits between the ``Server`` and the ``Worker``...
SyncApp protocol — fused sync request-response path for Pounce. When a SyncApp is provided, the sync worker calls...
SyncWorker — blocking I/O worker for request-response workloads. One request at a time per thread, no asyncio.
First-class testing utilities for pounce.
Worker — the heart of pounce's request handling. Runs a single asyncio event loop that accepts connections on a...