--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Read up about suspendable requests, oh it's gorgeous.
User request page that do long task (Controller.pageLongTask()):
public static void pageLongTask() {
render();
}
pageLongTask.html:
<img id="spinning" src="spinning.jpg" />
Loading...
$(document).ready() {
$.get(
"/longTask",
function(data) { $('#spinning').hide(); alert(data); },
);
}
And, longTask controller should be a suspended request that you can
see in documentation
of Play!:
public static void longTask() {
if (request.isNew) {
Future<String> task = new doVeryLongTask().now();
request.args.put("task", task);
waitFor(task);
}
render(((Future<String>) request.args.get("task")).get());
}
Note that this code is only for that you can have an idea of what
Morent want to describe, I didn't test this code!!
2011/3/28 obsfucation <chrisjam...@gmail.com>: