Skip to content

This repository contains the example code for my blog article Using Celery with Flask.

License

Notifications You must be signed in to change notification settings

nfvri/flask-celery-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Celery with Flask

Forked from https://github.com/miguelgrinberg/flask-celery-example

Related blog: Using Celery with Flask.

How to use

On a terminal:

docker-compose up

On another terminal:

  • Create a new task

    curl -X POST http:https://localhost:5555/longtask
    # task id returned
    
  • Check the task status

    curl -X GET http:https://localhost:5555/status/<task_id>
    

Experiments:

  • attempt to create (almost) concurrently N tasks, N > C, where C is the Celery "concurrency" specified in docker-compose.yml. Check the status of the queued tasks.
  • exec into the worker container, and check the celery processes. Verify they are equal to the specified concurrency

About

This repository contains the example code for my blog article Using Celery with Flask.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.3%
  • Dockerfile 5.7%