O'Reilly logo

Mastering Flask by Jack Stouffer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Creating Asynchronous Tasks with Celery

While creating web apps, it is vital to keep the time that a request takes to process below or around 50 ms. As the majority of response times are occupied by waiting for users' connection, and extra processing time may hang the server. Any extra processing on the server that can be avoided should be avoided. However, it is quite common for several operations in a web app to take longer than a couple of seconds, especially when complex database operations or image processing are involved. To save our user experience, a task queue named Celery will be used to move these operations out of the Flask process.

What is Celery?

Celery is an asynchronous task queue written in Python. Celery runs tasks, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required