Celery is such garbage to run/maintain at any sort of scale. Very excited for this. Rq/temporal also seem to solve this well. Anyone here done the migration off of celery to another thing? Any wisdom?
A first look at Django's new background tasks
41–49 of 49 posts
Re: A first look at Django's new background tasks
#42That's intersting to see. Does the api support progress reporting? ("30 % done") Of course one could build this manually when you're building the worker implementation but I'd love to have it reflected in the api somewhere. Celery also seems to be missing api for that. Anyone sees a reason why that's missing? I don't think it complicates the api much and seems such an obvious thing for longer-running background tasks…
Re: A first look at Django's new background tasks
#43That's intersting to see. Does the api support progress reporting? ("30 % done") Of course one could build this manually when you're building the worker implementation but I'd love to have it reflected in the api somewhere. Celery also seems to be missing api for that. Anyone sees a reason why that's missing? I don't think it complicates the api much and seems such an obvious thing for longer-running background tasks…
I had previously asked about this. My understanding is that there is a desire to add functionality to allow this, but in this first release the task system is intentionally very lightweight.
Re: A first look at Django's new background tasks
#44Earlier quoted context omitted.
To implement progress reporting, it means you are able to know the time a task would take to run upfront, no? Is it even possible to do it accurately ? Though, I imagine you could have strategies to give an approximation of it, for example like keeping track of the past execution time of a given type of task in order to infer the progress of a currently running task of the same type.
> To implement progress reporting, it means you are able to know the time a task would take to run upfront, no? No. You just need to know the total number of steps and what step are you currently on.
Does anyone know a task queue library that implement it ? I would be curious to look at it !
Re: A first look at Django's new background tasks
#45Earlier quoted context omitted.
I had previously asked about this. My understanding is that there is a desire to add functionality to allow this, but in this first release the task system is intentionally very lightweight.
Do you have any source one could follow? mail thread, bug tracker issue, ..?
Re: A first look at Django's new background tasks
#46Earlier quoted context omitted.
> To implement progress reporting, it means you are able to know the time a task would take to run upfront, no? No. You just need to know the total number of steps and what step are you currently on.
You're right, but I also don't find a way a task queue library could know that upfront either to implement progress reporting. Does anyone know a task queue library that implement it ? I would be curious to look at it !
I first learned about it from Miguel Grinberg's Flask tutorial: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial... But the same concept applies to Django.
Re: A first look at Django's new background tasks
#47Assuming 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.
I also warmly recommend procrastinate ! We moved all our celery tasks to procrastinate at work for all our django backends since almost two years now and it has been great. Having tasks deferred in the same transaction as the business logic stuff is something that helped us a lot to improve consistency and debugability. Moreover, it's so nice to able to inspect what's going on by just querying our database or just lo…
Re: A first look at Django's new background tasks
#48Celery is such garbage to run/maintain at any sort of scale. Very excited for this. Rq/temporal also seem to solve this well. Anyone here done the migration off of celery to another thing? Any wisdom?
Re: A first look at Django's new background tasks
#49Celery is such garbage to run/maintain at any sort of scale. Very excited for this. Rq/temporal also seem to solve this well. Anyone here done the migration off of celery to another thing? Any wisdom?