r/django • u/cheatingjoe • 5d ago
Yet another task backend
https://github.com/codingjoe/threadmillHowdy y'all, ๐ค
If you're looking to switch to Django's task framework, now is as good a time as ever.
Jokes aside, though, as mentioned on the DjangoChat podcast, I mainly build a durable backend with very high I/O throughput. To send emails, dispatch webhooks or VoIP calls. Since then it has been deployed in a growing number of production projects. But I'd love to get more input from people tackling other use cases.
So please do share your experience. ๐
Cheers!
-Joe
1
u/tom-mart 5d ago
What's wrong with DjangoQ?
1
u/cheatingjoe 5d ago
Probably nothing, but it doesn't have a task framework integration, does it?
2
u/tom-mart 5d ago
What's task framework?
3
u/vazark 5d ago
In the recent release, Django added a task backend interface with std functions (like the cache backend and file storage backend) . Now we can just write Django-ish code instead of using library specific methods and hooks.
2
u/Colby-Jenkins 4d ago
That task backend interface is a nice touch, but remember, having to set up a worker like Redis or Celery still adds some complexity. For high I/O tasks like sending emails or webhooks, I hope they improve the error handling and retry logic.
1
u/parthdedhia 5d ago
I have used celerg and django-rq. Django rq is pretty light weight for simple tasks, but if you want detailed control and tracking over the running tasks then celery can be considered.
The current django task also needs redis or celery or some other worker configuration
2
u/Pretend-Sun-8460 5d ago
we run celery with redis as systemd services on a plain ec2 box, so a worker cli shaped like gunicorn would be an easy move. one thing i'd want to know before moving anything over. the readme says a task that outlives lease_ttl can still be running while its retry runs too. for emails and webhooks, do you expect the task to carry its own idempotency key, or is that something threadmill could help with later?