Skip to main content

Durable execution framework for Django web apps.

Project description

Django Durable

Durable execution framework for Django web apps.

Workflows are ordinary Python functions using ctx.activity() and ctx.sleep(). On each step, we replay from the start and use the event log (HistoryEvent) to return prior results. Avoid non-deterministic branching not derived from previous results or inputs.

Activity and workflow results must be JSON-serializable.

Commands

python manage.py durable_start onboard_user --input '{"user_id": 7}'
python manage.py durable_worker --batch 20 --tick 0.2

Signals

  • In code, a workflow can wait for signals using ctx.wait_signal("signal_name"), which pauses execution until a matching signal arrives and returns its payload.
  • To send a signal from outside code:
python manage.py durable_signal <execution_uuid> user_clicked --input '{"clicked": true}'

You can also send a signal programmatically:

from django_durable.engine import send_signal
send_signal(execution_id, "user_clicked", {"clicked": True})

Cancellation

  • Cancel a workflow via CLI:
python manage.py durable_cancel <execution_uuid> --reason "user requested" [--keep-queued]
  • In code:
from django_durable.engine import cancel_workflow
cancel_workflow(execution_id, reason="user requested")

Cancellation moves the workflow to CANCELED and, by default, marks queued activities as failed so workers will not run them.

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_durable-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

django_durable-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file django_durable-0.1.1.tar.gz.

File metadata

  • Download URL: django_durable-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_durable-0.1.1.tar.gz
Algorithm Hash digest
SHA256 80bae52fbb3c1eccbcc2f3dab326b76f9036d327cf25b91fe94385630ee20d91
MD5 ec43b390f2f32a3bc94b279e0714f076
BLAKE2b-256 6b3d8076faa73e0f086358c8e856c614d247664a21c027ed9ea08a120891fd3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_durable-0.1.1.tar.gz:

Publisher: release.yml on grantjenks/django-durable

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_durable-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: django_durable-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_durable-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9cdab92284bc5d536d8d8010bae5d615641a8e1692d37a0447ccfffd6c6eb70
MD5 045c5e99ecc22d9ee01e271db0025f99
BLAKE2b-256 38260553bf54e1ffdd1d442a8ffc116d3711070f3a1ce8b15dd5a45aaa90e7dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_durable-0.1.1-py3-none-any.whl:

Publisher: release.yml on grantjenks/django-durable

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