3 ms·
The main problem with Celery is its overuse in the python world. It's not a bad project but sees a lot of negativity because it's used in places where it should
by spapas82 6y ago
The main problem with Celery is its overuse in the python world. It's not a bad project but sees a lot of negativity because it's used in places where it shouldn't! There are a lot of tutorials suggesting that using "async tasks" are required if you are interfacing with an external service (i.e like sending email). Most of these people suggest to actually use Celery for that.
Well, the fact is that if you are sending a couple of emails per hour for users that are registering to your site you don't need to use async tasks. Just offload them to your SMTP or use something like sendgrid. It won't matter to the user if there are a couple of seconds until he sees the http response or he gets the email after 1 minute. Also, even for other kinds of async tasks you can usually get away using a management command and a cron job running once per minute. Let's suppose your users may need to create a report that needs 1 minute to be created. Just flag it to run in your request response cycle and run it in the management task from cron. The user will be notified when it's been finished. Or even if you actually need that async task functionality, just start by using a simpler way to run async tasks (that aren't as complex as celery, don't need rabbit mq and can even use the database as a broker so you won't need any external parts). You almost probably don't need to support hundreds of async tasks per minute or complex task workflows using forks joins etc. I mean if you need to use celery you probably will know it.
- robbyt 6y agoAt first I thought you were going to say overuse or celery in the python world is a signal of how bad concurrency is in core python.