refactor: simplify proactor operations and naming - #9
Merged
Conversation
- Add SingleCqeOperation, which carries user_data/cqe_received handling and the common operate() shape; each concrete operation now only declares its fields, get_file_obj and _result. SendfileOperation keeps its custom multi-CQE logic. ~330 lines of copy-paste removed with identical behavior (all construction sites already used keyword args). - _ProactorSubmit's eleven identical prep methods now delegate to a single _prep helper, keeping the TypedDict-typed signatures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Rename IouringProactorEventLoop(-Policy) and _IouringWritePipeTransport to the IoUring prefix already used by IoUringProactor; the old public names remain importable as deprecated aliases. - Fix ProatorCache -> ProactorCache, test_tcp_conmmunication, 'C extention', and a 'woulbe' comment. - Drop the no-op try/finally in IoUringProactor.select. - Loop-test conftest now overrides pytest-asyncio's event_loop_policy fixture (the documented mechanism) instead of setting the global policy from an async autouse fixture, and drops the deprecated event_loop fixture nothing used. - Proactor-test conftest: use get_running_loop, guard the failure callback against cancelled tasks (task.exception() raises there), and remove the run_until_complete call that is invalid in a running loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bright2227
marked this pull request as ready for review
July 28, 2026 15:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IoUringnaming and correct related typosWhy
The operation and submission layers repeated the same ownership and registration logic across request types, making the proactor harder to review and maintain.
Impact
The io_uring request lifecycle is smaller and more consistent without intentionally changing runtime behavior.
Validation
uv run pytest -q— 17 passeduv run ruff check uringloop testsgit diff --check main...HEAD