11 messages in com.googlegroups.pylons-discussRe: Asynchronous HTTP requests
FromSent OnAttachments
jgar...@public.gmane.org26 Feb 2008 12:54 
Ryan Wynn26 Feb 2008 13:14 
jgar...@public.gmane.org26 Feb 2008 13:47 
Matt Feifarek27 Feb 2008 12:45 
Mike Orr27 Feb 2008 14:04 
Matt Feifarek27 Feb 2008 14:27 
Mike Orr27 Feb 2008 20:20 
jgar...@public.gmane.org28 Feb 2008 15:26 
Graham Dumpleton28 Feb 2008 15:39 
Marcin Kasperski03 Mar 2008 03:57 
Mike Orr03 Mar 2008 12:04 
Subject:Re: Asynchronous HTTP requests
From:Ryan Wynn (bigw@public.gmane.org)
Date:02/26/2008 01:14:25 PM
List:com.googlegroups.pylons-discuss

On Tue, Feb 26, 2008 at 3:54 PM,
jgar@public.gmane.org <jgar@public.gmane.org> wrote:

So, I'd like to try to build pages by making multiple asynchronous HTTP requests, something akin to what Google's map-reduce algorithm does.

I don't know enough about how Pylons actually works. I'm just now understanding the significance of WSGI and what Python Paste really does.

I think the code in my controller will look something like this:

def render(self): # Figure out what things need to be called # Create a dispatch map. # Set up dispatchers for them all using the map # Loop until everything has completed or until we get impatient # Assemble the results into a page and return it

For the looping part, I am not going to use the global map, but use a map unique to this particular request.

I am pretty new to pylons myself, but might I suggest that the first request builds your dispatch map and then simply passes it on to a view

Then inside the view you can setup further ajax requests based upon the values in the dispatch map. That way you don't have to block inside the controller and pieces of the pages can be assembled simultaneously.

Maybe I am not understanding all the complexity.

Question: Is this likely to interfere with how Pylons is setup by default? Does it spawn threads for each request, or what happens?

Comments are definitely welcome outside the scope of my questions.