The playframework documentation here says:
public static void loopWithoutBlocking() {
for(int i=0; i<=10; i++) {
Logger.info(i);
await("1s");
}
renderText("Loop finished");
}
I don’t understand how exactly this works:
for example, when we call the method in the first request i = 1, then ... unlock and wait .. and the new request goes to the method, and then it starts form i = 0 again? and when the first request wakes up, will it have i = 1 or 0 or 2?
No state mechanism is used here. for example, storage i .. between the request, for example?
source
share