Skip to main content

A Django Tasks backend which uses RQ as its underlying queue

Project description

Django Tasks RQ

CI PyPI PyPI - Python Version PyPI - Status PyPI - License

A Django Tasks backend which uses RQ as its underlying queue.

Installation

python -m pip install django-tasks

First, add django_tasks_rq to your INSTALLED_APPS:

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

Finally, add it to your TASKS configuration:

TASKS = {
    "default": {
        "BACKEND": "django_tasks_rq.RQBackend",
        "QUEUES": ["default"]
    }
}

Usage

The RQ-based backend acts as an interface between Django's tasks interface and RQ, allowing tasks to be defined and enqueued using django.tasks, but stored in Redis and executed using RQ's workers.

Any queues defined in QUEUES must also be defined in django-rq's RQ_QUEUES setting.

Job class

To use rq with django-tasks-rq, a custom Job class must be used. This can be passed to the worker using --job-class:

./manage.py rqworker --job-class django_tasks_rq.Job

Priorities

rq has no native concept of priorities - instead relying on workers to define which queues they should pop tasks from in order. Therefore, task.priority has little effect on execution priority.

If a task has a priority of 100, it is enqueued at the top of the queue, and will be the next task executed by a worker. All other priorities will enqueue the task to the back of the queue. The queue value is not stored, and will always be 0.

Contributing

See CONTRIBUTING.md for information on how to contribute.

Note: Prior to 0.12.0, this backend was included in django-tasks. Whilst the commit history was cleaned up, it's still quite messy. Don't look too closely.

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_rq-0.12.0.tar.gz (10.6 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_rq-0.12.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file django_tasks_rq-0.12.0.tar.gz.

File metadata

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

File hashes

Hashes for django_tasks_rq-0.12.0.tar.gz
Algorithm Hash digest
SHA256 84020a65d7b92d867f28d3002b4a6b07514eeda99b880ad91bb041d63e2191e0
MD5 06a3d0a2164e8201087bdcc1f47e40e4
BLAKE2b-256 30d3c964bd32d2fc5df173c49eaab418784034baaf66cfa84ce9be44e7073e2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_rq-0.12.0.tar.gz:

Publisher: ci.yml on RealOrangeOne/django-tasks-rq

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_rq-0.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tasks_rq-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ece4131fb31bd0410a958504c4491e81a4987eddd654b9b26311af96a743ba0d
MD5 0d1b199b4cceb7bcc6aa94f77e248445
BLAKE2b-256 33dd7cdc12b0ce24be13ecd6088c8baa2da4fa7e5b70c6f763570f0b0b750cbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_rq-0.12.0-py3-none-any.whl:

Publisher: ci.yml on RealOrangeOne/django-tasks-rq

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