I'm looking through the javadocs for the Rain project from Intel Research. What might be of interest to the growing discussion about continuation-based web servers?
Here's what... Continuation.java
This class provides a mechanism to continue a computation after a reply to a message has arrived. This works by associating a continuation with an outbound message using the associate method. When a reply to this message arrives, the service calls the invoke method on the continuation object. If the continuation was constructed with a timeout and a reply does not arrive within that time, the timeout method will be called. While this class is not abstract, it does very little of interest until either invoke , timeout or both are overridden.
By default, continuations are "single shot". This means that once a reply has been received, the continuation is removed from the continuation system. To create a continuation that can be invoked by multiple replies to a message, call setMultiShot with true. (Multi-shot continuations are useful in situations where multiple replies may come back for a single sent message.) Note that a multi-shot continuation with no timeout won't ever expire, so do not forget to remove them with the delete method.
No comments:
Post a Comment