标签:ring result ping call() sleep png 异步请求 call stc
@RestController
public class AsyncController {
private Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping("/order")
public DeferredResult<String> order() throws Exception {
logger.info("主线程开始");
Callable<String> result = new Callable<String>() {
@Override
public String call() throws Exception {
logger.info("副线程开始");
Thread.sleep(1000);
logger.info("副线程返回");
return "success";
}
};
return result;
}
}
标签:ring result ping call() sleep png 异步请求 call stc
原文地址:https://www.cnblogs.com/tekken-wang/p/12108698.html