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.3.0.tar.gz (27.3 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.3.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django_tasks_local_db-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f82f963c3ab9eedb7929d6e01079ab9c4c6dc571a53977def0061f6a94c9f9f1
MD5 990d590f2a0ec9bdea8f12370ae4ce26
BLAKE2b-256 d001dd2d743f2c06687cac03cc69335f479799fc55590216176aa4ad070d3042

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_local_db-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tasks_local_db-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49f1307b7850d1023da10d64f306e02a7089a46fdf169c2c23bea08c23d7952d
MD5 ef77636f208d70d24124c659bad0b658
BLAKE2b-256 f497f584cec8d2b7419d41c24fca3bb66e2dacbf4aae981111a9457b7683f81c

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_local_db-0.3.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