Skip to main content

Task Runner plugin for Fastpluggy

Project description

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...")

For detailed instructions on creating tasks and triggering them from JavaScript, see the Task Creation and JS Triggering Guide.

For information about Jinja template global variables available for task triggering, see the Jinja Template Globals documentation.


📋 Roadmap

✅ Completed / In Progress

  • Task registration with metadata (description, tags, max_retries, schedule, allow_concurrent)
  • Dynamic task form rendering via metadata
  • Notification system with:
    • Console / webhook / Slack (optional)
    • Selectable events: task_started, task_failed, logs, etc.
  • Context/report tracking in DB
  • Task retry linking via parent_task_id
  • CRON-based scheduler loop
  • Web UI for:
    • Task logs
    • Task reports
    • Scheduled tasks
    • Locks
    • Running task status
  • Lock manager (TaskLockManager) with DB tracking
  • 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

  • Auto-discovery of task definitions from modules
  • Celery-style shared task detection
  • Dynamic execution via run_by_name("slug", kwargs)

💾 Persistence & Rehydration

  • Save function reference + args for replay/retry
  • 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:

Does not work with SQLite due to JSONB field requirements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastpluggy_tasks_worker-0.2.33.tar.gz (76.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastpluggy_tasks_worker-0.2.33-py3-none-any.whl (102.5 kB view details)

Uploaded Python 3

File details

Details for the file fastpluggy_tasks_worker-0.2.33.tar.gz.

File metadata

  • Download URL: fastpluggy_tasks_worker-0.2.33.tar.gz
  • Upload date:
  • Size: 76.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for fastpluggy_tasks_worker-0.2.33.tar.gz
Algorithm Hash digest
SHA256 b6f16ae95ca48ec8de93908507ff98895baf97ecf9e09b8e899acf32d0b1c4ee
MD5 2cabbe41f651299d8cd05c355f59d85c
BLAKE2b-256 622457597023c89b22e92798638834c87d777ce4f3806601a7df74da719cce88

See more details on using hashes here.

File details

Details for the file fastpluggy_tasks_worker-0.2.33-py3-none-any.whl.

File metadata

File hashes

Hashes for fastpluggy_tasks_worker-0.2.33-py3-none-any.whl
Algorithm Hash digest
SHA256 31f02e0d07e4aea2da65d15b8dd0022a59b4bdbfc0f7faf42b1f51228a83c37c
MD5 17ff6823a19619f42e0937f171ecb2e3
BLAKE2b-256 fbba49e7cbbcb111616c22be011af5ab8ee7fc7c2a65f68eabb23ce108d005ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page