A first look at Django's new background tasks

roam.be

60 points by roam 4 hours ago


JakaJancar - 6 minutes ago

Assuming you're fine with keeping the queue in postgres, I've used Procrastinate and it's great:

https://procrastinate.readthedocs.io/en/stable/index.html

Core is not Django-specific, but it has an optional integration. Sync and async, retries/cancellation/etc., very extensible, and IMO super clean architecture and well tested.

IIRC think the codebase is like one-tenth that of Celery.

ethagnawl - 27 minutes ago

This is an exciting development. I imagine I'll continue using Celery in most cases but being able to transparently swap back-ends for testing, CI, etc. is very compelling.

I haven't looked into this in any detail but I wonder if the API or defaults will shave off some of the rough edges in Celery, like early ACKs and retries.

matsemann - 3 hours ago

How is the typing support? We just had downtime because a change to a celery task didn't trigger mypy to complain for all call sites until runtime. Too many python decorators aren't written with pretty weak typing support.

vforgione - 2 hours ago

I’ve been using the django-tasks library in production for about a year. The database backend and simple interface have been great. It definitely isn’t intended to replace all of celery, but for a simple task queue that doesn’t require additional infrastructure it works quite well.

the__alchemist - 2 hours ago

This is great! The prev recommendation was usually a lib called celery that I wasn't able to get working. I don't remember the details, but it had high friction points or compatibility barriers I wasn't able to overcome. This integration fits Django's batteries included approach.

I've been handling this, so far, with separate standalone scripts that hook into Django's models and ORM. You have to use certain incantations in an explicit order at the top of the module to make this happen.

fud101 - 17 minutes ago

Django this is about 10 years too late. It's frustrating because we use all manner of hacks to work around this being part of the builtin story.

fatih-erikli-cg - 3 hours ago

[dead]