django
django copied to clipboard
Fixed DEP 14 -- Implement Tasks interface
Trac ticket number
N/A - https://github.com/django/deps/blob/main/accepted/0014-background-workers.rst
Branch description
This PR implements the first parts of django.tasks, as implemented in django-tasks:
- Common API interface
- Base backend
- Task / result classes
- Immediate / Dummy backends
The database backend is intentionally absent, and will be added in future (after this PR is merged). This makes the PR significantly smaller, and easier to review.
The commits are also not squashed, to assist with iterative reviewing. I'll squash them all towards the end once the change is approved.
To do
- Documentation
Notable deviations from the DEP
- The email backend has been removed, as it isn't possible to be API-compatible, due to the need to return the number of successfully-sent emails.
- Enqueue and finished task signals were added, to allow easier introspection from day 1.
Checklist
- [x] This PR targets the
mainbranch. - [x] The commit message is written in past tense, mentions the ticket number, and ends with a period.
- [ ] I have checked the "Has patch" ticket flag in the Trac system.
- [x] I have added or updated relevant tests.
- [ ] I have added or updated relevant docs, including release notes if applicable (TBC).
- [ ] I have attached screenshots in both light and dark modes for any UI changes.
Just one comment: Missing periods at the end of some of the docstrings.
@carltongibson (as shepherd :sheep: ), what's the best way to get some Review Team eyeballs on this? Social media posting only gets the reviews so far.
@RealOrangeOne Good hustle! Right... let me mention it to some folks.
But also — create a Trac ticket "Add DEP 14 Task interface" (or similar), check Has Patch, link here, and change the title to Fixed #... -- . (Please also add carltongibson to the CC field on the ticket.) — That way it will appear on the Fellow's "Patches needing review" list, which is pretty much all important.
I had a feeling a ticket might be the way forward. Opened ticket-35859.
Something something more content for the DEP talk
I have this checked out and am going through and reviewing this. Excited about getting this moving forward, but have a lot of little nits and things I think we want to clean up. There's so much scar tissue around backends that I know we all have, so I think we can provide something great but not complicated here!
Really don't want to expand the scope, maybe some of this will involve simply hiding some stuff to future PRs. In any case hope to have finished reviewing this later tonight or tomorrow
Looking forward for this go out, any update on this?
@malkoG https://justinmayer.com/posts/any-updates/
Great comments @nessita. I should have time to implement them myself tomorrow