Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Archives

< Significant speed increase after upgrades   CodeZoo includes RIFE at last >
Continuations can be debugged, an example video of a RIFE application

Cedric has still doubts about continuations and most notably about how to debug them. RIFE implements partial web continuations on top of the JVM by using byte-code manipulation. This made it possible for us to implement it in a way that allows you to continue to use your usual Java debugger. Every debugger feature works since the byte-code is added without any debugging information and we preserve the existing debugging information from the original class.

This really gives you the best of both worlds: you're able to use continuations for the intuitive implementation of complex web application flows, and you can still use all the features of your tools.

To demonstrate how it works in real life, I've recorded a little movie of me playing a traditional number guessing game implemented with continuations.

Update: it seems that some people see this as a simple while loop and wonder what is special about it. This actually shows how nice it is: there's almost no difference with the regular Java application flow. The pause() method call interrupts the flow, stores the continuation and sends the response to the user. When the form is submitted, the flow continues right after the pause() call and the state is fully restored. If this wouldn't be the case, the first breakpoint in the method would be hit at each request, which doesn't happen. The while loop thus flows naturally and totally conforms to the flow that you want the user to experience (continue the game while the guess isn't the same as the answer). You don't have to be bothered by handling this flow manually and you don't have to preserve or restore the state.

QuickTimeWatch the annotated and interactive remake in flash (1.51 MB)

QuickTimeWatch the original video of a continuations debugging session (9,6MB)

posted by Geert Bevin in RIFE on Apr 18, 2005 11:00 PM : 2 comments [permalink]
 

Comments

Re: Continuations can be debugged, an example video of a RIFE application
Any caveats one should be aware of? thread safety, memory pressure, ... This turns upside down what's been know as 'web development' for the past 10 or so years...
Re: Continuations can be debugged, an example video of a RIFE application
Continuations are totally thread safe and memory pressure is solely related to the size of your local variable stack. We are successfully running several sites with 300000 daily page views on a basic single CPU 2GHz dell server with 2GB of RAM. The main limitation is currently that they can't be clustered, but we're working on adding serializable continuations that could be distributed via regular HTTP sessions. This should be finished in a month or two.

Add a new comment

Comments on this blog entry have been closed.

< Significant speed increase after upgrades   CodeZoo includes RIFE at last >
 
 
 
Google
rifers.org web