How to write a non blocking SimpleHTTPRequestHandler ?

Yassine Chaouche yacinechaouche at yahoo.com
Tue Feb 3 09:50:11 EST 2015


On Tuesday, February 3, 2015 at 3:17:37 PM UTC+1, Amirouche Boubekki wrote:
> What you want is to prevent the socket to wait indefinetly for data (based on strace output) which is done with socket.setblocking/settimeout [1]

Exactly ! thanks for taking time to reading my original post a second time. Maybe I didn't express my problem well enough and the discussion has maybe drifted to an XYProblem type discussion :)

I was about to say that most webframeworks for python already take care of the problem I'm facing, so I certainly confused people with improper formulation.

> There is contentbrowser [2] which is somekind of web proxy.

It's using werkzeug and it seems to be a full web application. I just want something that is right above sockets and selects. All that my script is doing is grabbing some json data from an external url provided by the browser and return a formatted page showing the json data in human-readable HTML pages. Nothing fancy.




More information about the Python-list mailing list