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.
Watch the annotated and interactive remake in flash (1.51 MB)
Watch the original video of a continuations debugging session (9,6MB)