Green Flask¶
The code for this example is located in the examples.flaskgreen.manage
module.
This script demonstrates the use synchronous web frameworks such as flask
in the context of asynchronous responses. It uses pulsar the greenio
module to run flask on a pool of greenlet.
This configuration allows the use of the greenlet-friendly EchoGreen
client within a flask response function.
The Echo server starts at the same time as the Flask WSGI server.
To run the script:
python manage.py
and point to http://localhost:8080 or any other sub urls.
Main Classes¶
Components¶
In this snippet the following components are used:
- Pulsar
MultiApp
- Pulsar
WSGIServer
- Pulsar
SocketServer
- Pulsar
GreenWSGI
For more information about writing server and clients check the writing clients tutorial.