django icon indicating copy to clipboard operation
django copied to clipboard

Fixed DEP 14 -- Implement Tasks interface

Open RealOrangeOne opened this issue 1 year ago • 1 comments

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 main branch.
  • [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.

RealOrangeOne avatar Sep 27 '24 10:09 RealOrangeOne

Just one comment: Missing periods at the end of some of the docstrings.

hvdklauw avatar Oct 11 '24 10:10 hvdklauw

@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 avatar Oct 22 '24 07:10 RealOrangeOne

@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.

carltongibson avatar Oct 22 '24 08:10 carltongibson

I had a feeling a ticket might be the way forward. Opened ticket-35859.

Something something more content for the DEP talk

RealOrangeOne avatar Oct 22 '24 08:10 RealOrangeOne

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

rtpg avatar Nov 05 '24 08:11 rtpg

Looking forward for this go out, any update on this?

malkoG avatar Apr 20 '25 22:04 malkoG

@malkoG https://justinmayer.com/posts/any-updates/

carltongibson avatar Apr 21 '25 09:04 carltongibson

Great comments @nessita. I should have time to implement them myself tomorrow

RealOrangeOne avatar Sep 15 '25 22:09 RealOrangeOne