Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAComboResponse - a combined buffered / streaming response #591

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 11 comments
Closed

WAComboResponse - a combined buffered / streaming response #591

GoogleCodeExporter opened this issue Mar 25, 2015 · 11 comments

Comments

@GoogleCodeExporter
Copy link

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

Original issue reported on code.google.com by [email protected] on 5 Aug 2010 at 4:15

Attachments:

@GoogleCodeExporter
Copy link
Author

Converted to .mcz which is easier for us.

Original comment by [email protected] on 5 Aug 2010 at 5:16

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

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.

Original comment by [email protected] on 5 Aug 2010 at 5:30

  • Added labels: Comet, Kom, Type-Feature
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

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).

Original comment by [email protected] on 5 Aug 2010 at 5:43

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 13 Aug 2010 at 9:30

  • Added labels: Milestone-3.1
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

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.

Original comment by [email protected] on 21 Aug 2010 at 6:52

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

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/

Original comment by [email protected] on 8 Sep 2010 at 7:47

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Can't we already do that if the response is streaming?

Original comment by [email protected] on 8 Sep 2010 at 8:45

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Ehm, yes, of course, ...

Original comment by [email protected] on 8 Sep 2010 at 9:12

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Wondering if this adapter is still in development, or if there are any known 
issues with it?

Original comment by [email protected] on 11 Oct 2011 at 3:56

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 19 Feb 2012 at 10:53

  • Changed state: Started
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

It tool us way too long but this is finally merged.

Original comment by [email protected] on 19 Feb 2012 at 4:26

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@marschall marschall modified the milestone: 3.1 Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants