full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

Documentation about Celery worker?

Open redm123 opened this issue 3 years ago • 2 comments

I saw this project includes a celery worker, and I'm trying to find out if I want/need this... But it's not clear to me what this does. How does it relate to this project? What would be the use cases and prerequisites? How does it work? I didn't find anything in the documentation. It would be helpful to drop a few words of explanation.

redm123 avatar Aug 15 '22 16:08 redm123

celery is a distributed task queue. It allows your application to have code that runs in the background, outside of the HTTP request-response cycle. For example, if you're sending an email in response to user action, you may not want the client/browser to wait for your application to complete the email delivery; or you may have computationally heavy task, and you don't want to consume a web worker for that, you may want to run that as a background task; or you may want to run a batch/scheduled task every day at 1am.

fastapi has a very basic built-in background worker which fulfills some tasks that you may want to use a background task queue for, but if you need anything more powerful then you can use something like celery.

lieryan avatar Aug 23 '22 11:08 lieryan