django-tasks - bringing background workers in to Django core

django-tasks is an accepted Enhancement Proposal to bring background workers into Django itself (as django.tasks). Introducing both a common API contract for developers and library authors (eg django.core.cache), but also a production-grade ORM-based worker and queue.

I gave a talk at Djangocon Europe last month introducing it:

Now, I need your help testing it, finding the issues, and adding features. The aim is to get it merged into Django 5.2 (April 2025, but the merge deadline is December 2024), and thereā€™s a lot still to do between now and then.

Give it a try, see how it works, and let me know what you think!

10 Likes

Hello! I saw your video and decided to come here to ask about it. Are you looking to eventually be able to interface with Celery or similar worker providers like RQ using the consistent django-tasks (or similarly named) API? I wasnā€™t exactly sure from the video whether thatā€™s the ultimate goal is to interface with the existing systems or to simply replace most use-cases with a DB-backed system.

Iā€™d like interops between existing implementations, yes. When and who writes them is still TBC. Thereā€™s a Celery backend in progress.

These will absolutely be in Django core, as itā€™s too much maintenance burden.

The DB backend will definitely be in Django core. Redis might come later to core, but thatā€™s not my decision to make. django-tasks will likely live on to contain the components which donā€™t make sense in Django core, and as a testing ground before integrating.

1 Like

The first PR, implementing the core API for background workers is up for review :tada: !

The notable omission is the database worker. This exists in django-tasks, but in the interest of easier review, isnā€™t in the first PR. Itā€™ll come later, once the core is merged.

Any and all review appreciated!

1 Like