Skip to content

Rebuild on stdlib loop machinery: subclass BaseEventLoop, remove Tokio, require Python 3.11+ - #1

Merged
jph00 merged 1 commit into
mainfrom
pr/rebuild-on-stdlib-loop-machinery-subclass
Aug 28, 2026
Merged

Rebuild on stdlib loop machinery: subclass BaseEventLoop, remove Tokio, require Python 3.11+#1
jph00 merged 1 commit into
mainfrom
pr/rebuild-on-stdlib-loop-machinery-subclass

Conversation

@jph00

@jph00 jph00 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The loop now subclasses base_events.BaseEventLoop and borrows the selector-loop method families it needs, so the previously transcribed create_connection/create_server/start_tls/subprocess bodies are inherited per-version instead of frozen at transcription time. SubprocessTransport is 20 lines over BaseSubprocessTransport, keeping only the executor spawn; transports adopt the stdlib _FlowControlMixin and gain BufferedProtocol support. The Tokio host is gone: the driver blocks directly in the polling reactor with the GIL released, which removes the ~1ms timer-granularity penalty, and embedding runtimes wake the loop through its thread-safe scheduling path. Rust drops to three files (243 lines); Python to ~400.

Crate API break (0.2.0): TokioCore and PyReactor::with_handle are removed. The Python surface is unchanged. Python floor rises to 3.11 (a 12-line shim covers the _run_forever_setup helpers that first appear in 3.12); CI now tests 3.11 through 3.14 and ships wheels for the same. DEV.md documents the architecture, the borrowed surface, and local multi-version testing via uv.

@jph00 jph00 added the enhancement New feature or request label Aug 28, 2026
@jph00
jph00 merged commit 1f296b2 into main Aug 28, 2026
@jph00
jph00 deleted the pr/rebuild-on-stdlib-loop-machinery-subclass branch August 28, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant