Skip to content

genagurbanguliyev/fastapi_celery_workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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

Try adding a few more workers to see how that affects things:

$ docker-compose up -d --build --scale worker=3

If you faced any errors during building try:

Rebuild Docker Images: If the image has been updated or there are changes in the Dockerfile, you need to rebuild the images. Use the following command to ensure a clean build:

$ docker-compose down --volumes
$ docker-compose up --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>

About

Asynchronous Tasks with FastAPI and Celery with any workers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published