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, ...
Get Mastering Flask now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.