Skip to content

About

Run a django-service-specs spec as a background task: a durable run record, and a worker that re-checks through dispatch.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

django-spec-tasks

CI PyPI Python versions Django versions Docs Coverage Ruff License

Run a django-service-specs spec as a background task: a durable run record, and a worker that re-checks through dispatch.

pip install "django-spec-tasks[celery]"        # or
pip install "django-spec-tasks[django-tasks]"  # the backport, below Django 6.0
from django_spec_tasks import TaskBinding, enqueue, read_run
from django_spec_tasks.backends.celery_backend import CeleryBackend

orders = TaskBinding(name="orders", registry=order_specs, backend=CeleryBackend())

run_id = enqueue(orders, "refund_order", {"order": "7"}, actor=request.user)
status = read_run(orders, run_id, request.user)

The queue decides where the code runs; the row decides whether it ran. A backend may lose a message or deliver it twice without consequence, which is what lets one protocol hold Celery and Django Tasks.

Read the documentation.

About

Run a django-service-specs spec as a background task: a durable run record, and a worker that re-checks through dispatch.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages