Skip to content

Task queues with Celery

In this part we cover the following topics:

Introduction to task queues

!!!To do!!!



  1. Choosing and installing a message transport (broker). !!!something about RabbitMQ!!!
  2. Celery install is pretty easy.
  3. Monitor Celery in Real Time. Flower is a real-time web-based monitor for Celery. Using Flower, you could easily monitor your task progress and history. As before, can use pip to install Flower:

Basic project

Below is the structure of our demo project.

  1. Leaev empty.
  2. Add the following code in
  3. In the file define our tasks
  4. Add the following code in
  5. Open terminal, let's call it Terminal 1

  6. Open second terminal, let's call it Terminal 2

    from 13:53:36 to 13:55:37 (2m 01s)

  7. The same time as in Terminal 2 we should be able to observe in Terminal 1 results similar to the following

  8. Run Flower. Having Celery still running in Terminal 1 open new terminal Terminal 3 and run Flower in it

  9. Open second terminal, Terminal 2 and run our job

    This time check what Flower allows us to control.

    Notice, that acording to Celery settings report displayed at start

    only one task is executed at a time.

    As previously, in Terminal 1 we should see the following results

  10. To allow (or force) Celery to execute more than one task at a time, use -c option (in Terminal 1 press Control + C to stop running Celery)
  11. Now execution of our job should be much more effective (use Terminal 2)

    from 14:25:08 to 14:25:39 (31s))