My favorites | Sign in
Project Home Wiki Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 591: WAComboResponse - a combined buffered / streaming response
3 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Closed:  Feb 2012

Sign in to add a comment
Reported by, Aug 4, 2010
Currently, a Seaside server adaptor must make an upfront decision about whether to allow a Seaside application to support partial responses (i.e., streaming) or not. Using WAStreamedResponse for this purpose, there are severe limits as it uses an outdated mechanism for streaming (transient http responses). WAComboResponse provides an alternative.

From WAComboResponse's class comment:
WAComboResponse is a combination of a buffered and a streaming response. By default, WAComboResponse will buffer the entire response to be sent at the end of the request processing cycle. If streaming is desired, the response can be flushed by sending it the #flush message. Flushing a response will sent all previously buffered data using chunked transfer-encoding (which preserves persistent connections). Clients can flush the response as often as they want at appropriate points in their response generation; everything buffered up to that point will be sent. For example, a search results page might use something like:

renderContentOn: aCanvas
	"Render the search page"

	self renderSearchLabelOn: aCanvas.
	aCanvas flush. "flush before starting search to give immediate feedback"

	self searchResultsDo:[:aResult|
		self renderSearchResultOn: aCanvas.
		aCanvas flush. "flush after each search result"

After a response has been flushed once, header modifications are no longer possible and will raise a WAIllegalStateException.

Server adaptors need to be aware that a committed response must be closed, when complete. An uncommitted response should be handled as usual by the server adapter.

The attached three files provide all necessary changes:
* WAComboResponse.cs provides the implementation of WAComboResponse
* CometFixes.cs provide necessary fixes for Comet.
* ComancheFixes.cs provides an (admittedly ugly) patch for WAComancheServerAdaptor to make it streaming

6.5 KB   View   Download
1.5 KB   View   Download
1.6 KB   View   Download
Aug 4, 2010
Project Member #1
Converted to .mcz which is easier for us.
11.9 KB   Download
38.5 KB   Download
20.1 KB   Download
261 KB   Download
Aug 4, 2010
Project Member #2
As long as we don't have custom actions on the server (enable/disable streaming) I wouldn't want to change the default behavior of WAComancheAdaptor to change to streaming. Simply because by can't render an exception page anymore if the response is already committed.
Labels: -Type-Defect Type-Feature Comet Kom
Aug 4, 2010
That's fine with me but I'd like to point out that the default behavior will not change unless the application actually sends #flush. If the app isn't streaming (i.e., sending #flush) the exception page will show (try it).

Aug 13, 2010
Project Member #4
(No comment was entered for this change.)
Labels: Milestone-3.1
Aug 21, 2010
I am voting for a solution to this, because I am troubled that I can (and have got) get a walkback in my image due to Socket>>waitForDataFor: which raises an exception.

I would like to see some solution to prevent this - at the very least I shouldn't get an a debugger - and just something in a log file.
Sep 8, 2010
Project Member #6
This would also allow us to do a special render continuation that flushes after #updateRoot: so the whole header with CSS and JS gets pushed to the client and it can start downloading these resources:
Sep 8, 2010
Project Member #7
Can't we already do that if the response is streaming?
Sep 8, 2010
Project Member #8
Ehm, yes, of course, ...
Oct 11, 2011
Wondering if this adapter is still in development, or if there are any known issues with it?
Feb 19, 2012
Project Member #10
(No comment was entered for this change.)
Status: Started
Feb 19, 2012
Project Member #11
It tool us way too long but this is finally merged.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting