Helma Logo
main list history
previous version  overview  next version

Version 4 by hannes on 05. February 2008, 10:58

=== Rhino Continuations

Rhino continuations allow to capture the state of a complete running script to be resumed later on.


Rhino continuations only work in interpreter mode with the compiler disabled, i.e. with optlevel -1.

Rhino continuations can be made to work quite easily in Helma 1.6, using for example the callback feature from Gobi's Markup.js. Interestingly, the req/res references work correctly out of the box for resumed continuations, probably due to the way Rhino implements dynamic scopes (i.e. the per-thread scope is looked up at runtime anyway).

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


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


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