2
我有一個看起來像這樣的資源的方法:如何在Dropwizard中使用Jetty Continuations?
@Path("/helloworld")
@GET
public Response sayHello(@Context HttpServletRequest request)
throws InterruptedException {
Continuation c = ContinuationSupport.getContinuation(request);
c.suspend();
Thread.sleep(1000);
c.resume();
return Response.ok("hello world hard").build();
}
看來,當我把這個端點,dropwizard結束調用無限循環sayHello方法。我是否正確地做這件事?