playframework/play — pull request #532 by SiyuanHe (2012-08-10 17:55:53+00:00)
Title: [#1333] allow to throw timeout exception when await(Promise) exceeds the timeout limit

The following code expects to get a time out exception. But the application/request is just suspended forever.

public class MyController extends Controller
{
public static void testAsync()
{
F.Promise remoteCall1 = WS.url("http://my_webserver/random1").timeout("5s").getAsync();
// http://my_webserver is designed to return /random1 in 10seconds, which means promise1 will timeout
F.Promise> promises = F.Promise.waitAll(remoteCall1);
await(promises);

System.out.println("End");
render();
}
}