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方法。我是否正确地做这件事?