Helma Logo
main list history
previous version  overview  next version

Version 3 by hannes on 21. December 2007, 18:33

Jetty === Rhino Continuations
http://docs.codehaus.org/display/JETTY/Continuations
This is not a "real" continuation as this isn't supported by Java. Instead, it relies on "that all actions taken by a filter or servlet before a call to suspend(long) are either idempotent (can be retried) or are made conditional on isPending() so they are not performed on retried requests".
http://jetty.mortbay.com/apidocs/org/mortbay/util/ajax/Continuation.html

Rhino Continuations (suspend continuations allow to capture the state of a complete running script state): to be resumed later on.

http://wiki.apache.org/cocoon/RhinoWithContinuations
Does not reflect current implementation, but this is the best I could find.

Rhino and Jetty continuations can be used alone or only work in combination to create various interesting tricks:interpreter mode with the compiler disabled, i.e. with optlevel -1.

* Send back a page and continue on Rhino continuations can be made to work quite easily in Helma 1.6, using for example the same spot callback feature from Gobi's Markup.js. Interestingly, the next time req/res references work correctly out of the client sends a requestbox for resumed continuations, probably due to the way Rhino implements dynamic scopes (i.e. the per-thread scope is looked up at runtime anyway).
* Keep connection open and for use by other threads of control
* Keep connection open for use by same thread of controlWhat needs more work is serialization support. Persistent HopObjects shouldn't be included in a serialized continuation, so we need to convert Nodes into NodeHandles in the output stream, and convert back to Nodes in the input stream. The latter currently fails in session restore because it requires a Transactor thread. For global references we need to make sure they're excluded from serialization. Helma 1.7 seems like a good timeframe to fix these issues.

Note: as of this writing, continuation support is broken in Rhino HEAD. The fix is quite trivial, see bug 403604. <https://bugzilla.mozilla.org/show_bug.cgi?id=403604>

=== Jetty Continuations

Jetty continuations are a mechanism to keep HTTP connections pending without having a Java thread associated with the request.

http://docs.codehaus.org/display/JETTY/Continuations

This is not a "real" continuation as this isn't supported by Java. Instead, it relies on "that all actions taken by a filter or servlet before a call to suspend(long) are either idempotent (can be retried) or are made conditional on isPending() so they are not performed on retried requests".

http://jetty.mortbay.com/apidocs/org/mortbay/util/ajax/Continuation.html

Jetty continuations are a means to allow AJAX polling without a thread penalty.

     removed
     added