0
我有一个看起来像这样的资源的方法:如何在Dropwizard中使用Servlet 3.0异步方法?
@Path("hard")
@GET
public Response sayHello2(@Context HttpServletRequest request)
throws InterruptedException {
AsyncContext ac = request.startAsync();
Thread.sleep(1000);
ac.complete();
return Response.ok("hello world hard").build();
}
它看起来像代码贯穿而过,但我似乎无法验证异步工作在这种情况下?我正确使用这个吗?