[web2py] Re: Async http request in web2py

2011-02-18 Thread KMax
asynchronous http and synchronous http What the difference ? On 18 фев, 10:37, Dane dane.schnei...@gmail.com wrote: Hi, I need to make an asynchronous http request to one of my controller functions in order to some lightweight background processing (refreshing some cached objects). I came

[web2py] Re: Async http request in web2py

2011-02-18 Thread Dane
Synchronous http makes the call and stops further execution until the result is returned. Async makes the call and optionally provides a callback so that further code can be executed while waiting for the response. The way ajax calls with in javascript, for example. Seems like basic

[web2py] Re: Async http request in web2py

2011-02-18 Thread Massimo Di Pierro
It is more complex than this. It is about two different models to handle concurrency. In one model you have one thread per request. Each request does IO with the client within one thread. The web server creates and manages the threads connects the thread to the web app (for example web2py) via

[web2py] Re: Async http request in web2py

2011-02-18 Thread Dane
Thanks for the explanation Massimo. I figured it must be an issue with python's architecture or something would have been added to the std lib by now. It's easy enough to simulate this behavior with ajax calls to controllers from the client. Unfortunately since you can't rely on javascript being

Re: [web2py] Re: Async http request in web2py

2011-02-18 Thread Vasile Ermicioi
Sort of peculiar how a browser on the client's computer is more capable in this area than a powerful web server. If you need async calls you can take a look at gevent, eventlet or twisted But put in your mind the main difference: the browser is running continuously (until you close it),