ZnZincStreamingServerAdaptor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ZnZincStreamingServerAdaptor

Sven Van Caekenberghe-2
Hi,

Ken Treis did a beautiful hack and added a ZnZincStreamingServerAdaptor to Zinc-Seaside.

This WAServerAdaptor and subclass of ZnZincServerAdaptor relies on WAComboResponse to generate a response in a streaming fashion (more specifically using chunked transfers for indeterminate sized responses).

Here is Ken's example:

> renderContentOn: html
> html heading: 'Stream Test'.
> (1 to: 5)
> do: [ :i |
> html
> paragraph: [
> html
> text: i;
> text: '. Each of these paragraphs should appear a few seconds apart.'.
> self requestContext response flush ] ]
> separatedBy: [ (Delay forSeconds: 2) wait ]

For certain use cases, this is a very important feature to have.

Feel free to test this new adaptor and don't hesitate to give feedback and/or help improve it.

Thanks a lot, Ken !

Sven

PS: It is worth noting that with the WAComboResponse the whole responsibility to generate the response is no longer with Zinc but with WAComboResponse as it writes on the raw stream itself, the status line, the headers and body chunks.

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside