My favorites | Sign in
Project Home Wiki Issues
New issue   Search
for
  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
Owner:  philippe...@gmail.com
Closed:  Feb 2012
Kom


Sign in to add a comment
 
Reported by andreas....@gmail.com, 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

WAComboResponse.cs
6.5 KB   View   Download
CometFixes.cs
1.5 KB   View   Download
ComancheFixes.cs
1.6 KB   View   Download
Aug 4, 2010
Project Member #1 philippe...@gmail.com
Converted to .mcz which is easier for us.
Comet-Core-pmm.51.mcz
11.9 KB   Download
Grease-Core-pmm.43.mcz
38.5 KB   Download
Seaside-Adaptors-Comanche-pmm.63.mcz
20.1 KB   Download
Seaside-Core-pmm.653.mcz
261 KB   Download
Aug 4, 2010
Project Member #2 philippe...@gmail.com
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
#3 andreas....@gmail.com
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 philippe...@gmail.com
(No comment was entered for this change.)
Labels: Milestone-3.1
Aug 21, 2010
#5 tamackin...@gmail.com
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 philippe...@gmail.com
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:

http://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-plan/
Sep 8, 2010
Project Member #7 jfitz...@gmail.com
Can't we already do that if the response is streaming?
Sep 8, 2010
Project Member #8 philippe...@gmail.com
Ehm, yes, of course, ...
Oct 11, 2011
#9 johnptoo...@gmail.com
Wondering if this adapter is still in development, or if there are any known issues with it?
Feb 19, 2012
Project Member #10 philippe...@gmail.com
(No comment was entered for this change.)
Status: Started
Owner: philippe...@gmail.com
Feb 19, 2012
Project Member #11 philippe...@gmail.com
It tool us way too long but this is finally merged.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting