fastapi-celery
fastapi-celery copied to clipboard
Example of how to handle background processes with FastAPI, Celery, and Docker
Asynchronous Tasks with FastAPI and Celery
Example of how to handle background processes with FastAPI, Celery, and Docker.
Want to learn how to build this?
Check out the post.
Want to use this project?
Spin up the containers:
$ docker-compose up -d --build
Open your browser to http://localhost:8004 to view the app or to http://localhost:5556 to view the Flower dashboard.
Trigger a new task:
$ curl http://localhost:8004/tasks -H "Content-Type: application/json" --data '{"type": 0}'
Check the status:
$ curl http://localhost:8004/tasks/<TASK_ID>