Skip to content

refactor: simplify proactor operations and naming - #9

Merged
bright2227 merged 2 commits into
mainfrom
refactor/proactor-cleanup
Jul 28, 2026
Merged

refactor: simplify proactor operations and naming#9
bright2227 merged 2 commits into
mainfrom
refactor/proactor-cleanup

Conversation

@bright2227

Copy link
Copy Markdown
Owner

Summary

  • collapse duplicated operation classes into shared request/operation structures
  • consolidate repetitive proactor submission methods
  • standardize IoUring naming and correct related typos
  • simplify test fixtures and update affected documentation

Why

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 passed
  • uv run ruff check uringloop tests
  • git diff --check main...HEAD

bright2227 and others added 2 commits July 28, 2026 23:10
- 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
bright2227 marked this pull request as ready for review July 28, 2026 15:16
@bright2227
bright2227 merged commit 5ce02f9 into main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant