Understanding asynchronous operations

Some of the operations in a web application can be time-consuming and make the overall application feel slow for the user, even though it's not actually slow. This decreases the user experience significantly. To deal with this, the simplest way to implement the asynchronous execution of operations is with the help of threads. In this recipe, we will implement it using the thread and threading libraries of Python. The threading library is simply an interface over thread; it provides more functionality and hides things that are normally not used by users.

Getting ready

We will use the application from the E-mail support for Flask applications recipe. Many of us will have noticed that while the e-mail is being ...

Get Flask Framework Cookbook 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.