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
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
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
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
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),
5 matches
Mail list logo