tiangolo / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation about Celery worker?

redm123 opened this issue · 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.

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.