FastPluggy Task Runner
A powerful and extensible task execution framework for Python, built on top of FastPluggy.
Easily register, run, monitor, and schedule background tasks with full support for retries, logging, live WebSocket updates, and notifications.
β¨ Features
- π§ Task registration with metadata, retries, scheduling, and custom parameters
- π§ Dynamic form generation from metadata
- π‘ Live logs and WebSocket updates
- π CRON-based scheduler with optional notification rules
- π Retry logic with auto-link to parent task
- π Non-concurrent task execution with lock tracking
- π§© Extensible notifier system (Console, Slack, Webhook...)
- π Admin UI to manage tasks, schedules, locks, and reports
- πΎ Persistent task context and rehydration
- π Task metrics from process/thread info
π οΈ How It Works
from ..task_registry import task_registry
@task_registry.register(
description="Sync data every 5 mins",
schedule="*/5 * * * *",
max_retries=3,
allow_concurrent=False
)
def sync_data_task():
print("Sync running...")
π Roadmap
β Completed / In Progress
- [x] Task registration with metadata (
description
,tags
,max_retries
,schedule
,allow_concurrent
) - [x] Dynamic task form rendering via metadata
- [x] Notification system with:
- Console / webhook / Slack (optional)
- Selectable events:
task_started
,task_failed
,logs
, etc. - [x] Context/report tracking in DB
- [x] Task retry linking via
parent_task_id
- [x] CRON-based scheduler loop
- [x] Web UI for:
- Task logs
- Task reports
- Scheduled tasks
- Locks
- Running task status
- [x] Lock manager (
TaskLockManager
) with DB tracking - [x] Cancel button for live-running tasks
π Upcoming Features
π Task Queue Enhancements
- [ ] Priority & rate-limit execution
- [ ] Per-user concurrency limits
- [ ] Task dependencies / DAG runner
π§ Task Registry & Detection
- [x] Auto-discovery of task definitions from modules
- [x] Celery-style shared task detection
- [ ] Dynamic execution via
run_by_name("slug", kwargs)
πΎ Persistence & Rehydration
- [ ] Save function reference + args for replay/retry
- [x] Task dependency tree and retry visualization
π Remote Workers
- [ ] Register and manage remote workers
- [ ] Assign tasks based on tags/strategies
- [ ] Remote heartbeat & health monitoring
π Observability
- [ ] Task metrics via
psutil
(CPU, memory, threads) - [ ] UI views for thread/process diagnostics
π¦ Tech Stack
- FastAPI + FastPluggy
- SQLAlchemy + SQLite/PostgreSQL
- WTForms + Jinja2 + Bootstrap (Tabler)
- WebSockets for real-time feedback
- Plugin-ready & modular architecture
π§ Philosophy
This runner is built to be:
- Introspective: auto-generate UIs from functions
- Composable: integrate with your FastPluggy app
- Scalable: support single-machine and multi-worker environments
- Extensible: notifiers, hooks, CRON, logs
π License
MIT β Use freely and contribute π
π Contributions Welcome!
Open issues, send PRs, share ideas β
Letβs build the most pluggable Python task runner together.
WArning :
not works with sqlite due to jsonb field needed