refactor(async): enforce async-separation + arun_worker kwarg parity#56
Merged
pratyush618 merged 1 commit intomasterfrom Apr 24, 2026
Merged
refactor(async): enforce async-separation + arun_worker kwarg parity#56pratyush618 merged 1 commit intomasterfrom
pratyush618 merged 1 commit intomasterfrom
Conversation
- Move JobResult.astream into AsyncJobResultMixin alongside aresult. - Extract group/chord.apply_async into async_support/canvas.py as AsyncGroupMixin and AsyncChordMixin; canvas.py and result.py no longer import asyncio. - Add missing pool and app kwargs to AsyncQueueMixin.arun_worker; update the Protocol run_worker stub to match. - Async canvas path delegates to Signature.apply() and dataclasses.replace() to deduplicate the wave/chord enqueue loops. Addresses P1 items from the 2026-04-23 audit (async-separation violations in canvas.py / result.py, arun_worker signature drift).
eb3da54 to
5eb1943
Compare
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
Closes two P1 items from the 2026-04-23 audit that were still open after PR #53 landed the P0 fixes.
py_src/taskito/canvas.pyandpy_src/taskito/result.pyno longerimport asyncio.JobResult.astreamis moved intoAsyncJobResultMixinalongsidearesult.group.apply_async/chord.apply_asyncare extracted into a newasync_support/canvas.pyasAsyncGroupMixin/AsyncChordMixin, and the sync classes inherit from them. This keeps the project's rule thatasynciolives only underasync_support/(plus the two documented exceptions).arun_workerkwarg parity —AsyncQueueMixin.arun_workernow acceptspoolandapp, matching the syncrun_workersignature introduced with the prefork pool. The Protocolrun_workerstub insideAsyncQueueMixinis updated to match.Signature.apply()and usedataclasses.replace()for the chord callback rebuild, collapsing the inline enqueue-loop duplication that existed before.Verification
cargo check --workspace+--features postgres+--features redis+--features native-async— all cleancargo test --workspace— all passuv run pytest tests/python/— 432 passed, 9 skippeduv run ruff check py_src/ tests/— cleanuv run mypy py_src/taskito/+ tests — cleanTest plan
py_src/andtests/asyncioreferences remain incanvas.pyorresult.pyarun_workerforwardspoolandapptorun_worker