Skip to main content

Django Tasks backend combining in-process thread pool execution with database persistence

Project description

django-tasks-local-db

A Django Tasks backend that combines in-process thread pool execution with database persistence. Tasks run in your web process without a separate worker, while results are durably stored in the database.

This project is a remix of django-tasks-local and django-tasks-db. It takes the in-process executor approach from django-tasks-local and adds DB-backed result storage from django-tasks-db.

How it works

  • enqueue() writes a task row to the database, then submits it to an in-process thread pool
  • On completion, the DB row is updated with the result or error
  • On restart, orphaned tasks are recovered from the database and resubmitted

Installation

pip install django-tasks-local-db

Configuration

INSTALLED_APPS = [
    # ...
    "django_tasks_local_db",
]

TASKS = {
    "default": {
        "BACKEND": "django_tasks_local_db.LocalDBBackend",
        "OPTIONS": {
            "MAX_WORKERS": 4,
        },
    }
}

Then run migrations:

python manage.py migrate django_tasks_local_db

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

django_tasks_local_db-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

django_tasks_local_db-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file django_tasks_local_db-0.1.0.tar.gz.

File metadata

  • Download URL: django_tasks_local_db-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_tasks_local_db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31254c770235390a50ca63313b635e255c2bc43b7b5685d83d1711b6dcd3d16f
MD5 639123f396499cc306ceb505481fadd5
BLAKE2b-256 a356f1beba013431b49ef8303c6e39e2b94ed73b1c148ee3c188a7ba7529dbfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_local_db-0.1.0.tar.gz:

Publisher: release.yml on fgregg/django-tasks-local-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_tasks_local_db-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tasks_local_db-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ef20ccc652fd8fe0a8218de6d26878b269a125937efdbeb9fadd25a2a93fe99
MD5 0965ac2302d6ed93afd2ca2ccdfe3f75
BLAKE2b-256 7bad7ae0bca3236dc83c4f8053004d7d9dc29a1b606eb4e44fcdbcb03c563cf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_local_db-0.1.0-py3-none-any.whl:

Publisher: release.yml on fgregg/django-tasks-local-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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