Understanding asynchronous capabilities in Flask
Flask is a minimalistic framework in which you can implement your own interpretation of the MVC pattern. The framework is loosely constrained in terms of what you can do, but in its roots Flask is conceived as a Web Server Gateway Interface (WSGI) supported application. WSGI defines a standard interface between HTTP and Python, which means that to deploy a Flask-based solution you need a Web server that handles HTTP requests, translates them into Python through WSGI, and then returns the responses back to the client. Figure 7.2 shows how WSGI applications operate:

Figure 7.2: WSGI application operation
You will notice that in this schema there are two points at which you can address concurrency in your applications: the web server and the application itself. Interestingly, you can test different approaches to handling concurrency approaches, including asynchronous, in some WSGI servers (like Gunicorn https://docs.gunicorn...