Skip to content

refactor: split app.py into mixins package#94

Merged
pratyush618 merged 1 commit intomasterfrom
refactor/app-mixin-split
May 1, 2026
Merged

refactor: split app.py into mixins package#94
pratyush618 merged 1 commit intomasterfrom
refactor/app-mixin-split

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

  • Convert flat mixins.py (384 lines) into mixins/ package
  • Move task/periodic decorators, hooks, resources, events, worker lifecycle out of the 1473-line Queue class into focused mixins
  • app.py now keeps only __init__, enqueue, enqueue_many, _wrap_task, and helpers (1473 → 590)

What moved where

  • mixins/inspection.py, mixins/operations.py, mixins/locks.py — existing mixins, moved verbatim
  • mixins/decorators.pytask, periodic, before_task/after_task/on_success/on_failure, register_type, set_queue_rate_limit, set_queue_concurrency
  • mixins/resources.pyworker_resource, register_resource, health_check, load_resources, proxy_stats, interception_stats
  • mixins/events.py_emit_event, on_event, add_webhook
  • mixins/lifecycle.pyrun_worker, _print_banner, _run_heartbeat, resource_status, test_mode

Test plan

  • uv run ruff check py_src/
  • uv run mypy py_src/taskito/ --no-incremental
  • uv run python -m pytest tests/python/ -v — 465 passed, 9 skipped
  • No public API changes; the 19 internal callers of from taskito.app import Queue are unaffected

Move task/periodic decorators, hooks, resources, events, and worker
lifecycle out of the 1473-line Queue class into focused mixins under a
new mixins/ package. Queue keeps __init__, enqueue, enqueue_many, and
_wrap_task. No behavior changes.
@github-actions github-actions Bot added the python label May 1, 2026
@pratyush618 pratyush618 merged commit 2b3c664 into master May 1, 2026
19 checks passed
@pratyush618 pratyush618 deleted the refactor/app-mixin-split branch May 2, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant