[Web-SIG] Server-side async API implementation sketches

chris.dent at gmail.com chris.dent at gmail.com
Mon Jan 10 10:48:23 CET 2011


On Sun, 9 Jan 2011, Alice Bevan–McGregor wrote:

> On 2011-01-09 09:03:38 -0800, P.J. Eby said:
>> Hm.  I'm not sure if I like that.  The typical app developer really 
>> shouldn't be yielding multiple body strings in the first place.
>
> Wait; what?  So you want the app developer to load a 40MB talkcast MP3 into 
> memory before sending it?

My reaction too. I've read this elsewhere on this list too, in other
topics. A general statement that the correct way to make an
efficient WSGI (1) app is to return just one body string.

This runs contrary to everything I've ever understood about making
web apps that appear performant to the user: get the first byte out to
the browser as soon as possible.

This came up in discussions of wanting to have a cascading series of
generators (to save memory and improve responsiveness): store
generates data, serializers generates strings, handler generates
(sends out in chunks) the web page from those strings.

So, this is me saying: I'm in favor of a post-wsgi1 world where apps
are encouraged to be generators. To me they are just as useful in
sync and async contexts.

-- 
Chris Dent                                   http://burningchrome.com/
                                 [...]


More information about the Web-SIG mailing list