In this particular example, the client-side view is done using a simple theme bootstrap page included in the Python Flask templates folder, and the number processing logic is maintained in a static JavaScript application.js file. The index.html page used by the server contains a small client-side application using jQuery and SocketIO.
The main difference between Flask-Sockets and Flask-SocketIO is that the former is a wrapper around the native WebSocket protocol (thanks to the use of the gevent-websocket project), so it can only be used in most modern browsers that have built-in support. Combining WebSocket with the Web Application equivalent of Flask will make it a real-time web application that implements dual communication with the ease of WebSocket.
Flask-SocketIO also creates an event handler environment similar to that of regular display functions, including creating application and request contexts. Deploying multiple worker processes gives applications using Flask-SocketIO the ability to distribute client connections across multiple processes and hosts and thus scale to support a very large number of concurrent clients.
Comments