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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80bae52fbb3c1eccbcc2f3dab326b76f9036d327cf25b91fe94385630ee20d91
|
|
| MD5 |
ec43b390f2f32a3bc94b279e0714f076
|
|
| BLAKE2b-256 |
6b3d8076faa73e0f086358c8e856c614d247664a21c027ed9ea08a120891fd3b
|
Provenance
The following attestation bundles were made for django_durable-0.1.1.tar.gz:
Publisher:
release.yml on grantjenks/django-durable
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_durable-0.1.1.tar.gz -
Subject digest:
80bae52fbb3c1eccbcc2f3dab326b76f9036d327cf25b91fe94385630ee20d91 - Sigstore transparency entry: 453441745
- Sigstore integration time:
-
Permalink:
grantjenks/django-durable@06d55811877a328aa3b29658af6384c52c362ec5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/grantjenks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@06d55811877a328aa3b29658af6384c52c362ec5 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9cdab92284bc5d536d8d8010bae5d615641a8e1692d37a0447ccfffd6c6eb70
|
|
| MD5 |
045c5e99ecc22d9ee01e271db0025f99
|
|
| BLAKE2b-256 |
38260553bf54e1ffdd1d442a8ffc116d3711070f3a1ce8b15dd5a45aaa90e7dd
|
Provenance
The following attestation bundles were made for django_durable-0.1.1-py3-none-any.whl:
Publisher:
release.yml on grantjenks/django-durable
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_durable-0.1.1-py3-none-any.whl -
Subject digest:
d9cdab92284bc5d536d8d8010bae5d615641a8e1692d37a0447ccfffd6c6eb70 - Sigstore transparency entry: 453441763
- Sigstore integration time:
-
Permalink:
grantjenks/django-durable@06d55811877a328aa3b29658af6384c52c362ec5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/grantjenks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@06d55811877a328aa3b29658af6384c52c362ec5 -
Trigger Event:
push
-
Statement type: