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 mod_wsgi.

In another model you do not have threads. You have async IO. It allows
to serve more clients at the same time if the requests are really
simple. If the computation is significative you may have concurrency
issues.

Then you can heve async io with ligthweight thread within is the best
of both worlds.

Python does not have built-in lightweight threads. web2py is based on
mod_wsgi which does not support async.

Anyway, this is not a definitive word on the subject.

Massimo





On Feb 18, 9:15 pm, Dane <dane.schnei...@gmail.com> wrote:
> 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 functionality--strange that something so useful isn't
> built in to python in a straightforward way. It would be great if
> web2py could do something to address this. There are many use cases
> and it's much easier and lighter weight than dealing with threads,
> processes, cron, etc. when all that is needed is a quick non-blocking
> call.
>
> On Feb 18, 8:52 am, KMax <mkostri...@gmail.com> wrote:
>
>
>
>
>
>
>
> > 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 upon this thread:
>
> > >http://groups.google.com/group/web2py/browse_thread/thread/bbe66f1084...
>
> > > But the link to the "lola" function posted post by Massimo is broken.
> > > Can anyone supply a new link or explain a simple way to make async,
> > > ajax-like requests from within web2py? Thanks.
>
> > > -Dane

Reply via email to