文章详情页
java - Spring 中的WebAsyncManager 有什么应用场景?
浏览:217日期:2023-12-15 14:32:18
问题描述


说明:第一张图片是FrameworkServlet的processRequest方法,
问题:
(1) WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
asyncManager.registerCallableInterceptor(FrameworkServlet.class.getName(), new RequestBindingInterceptor());
这两行代码有什么作用
(2)WebAsyncManager 是处理什么问题的,应用在什么场景?
前辈、大神不吝指点
问题解答
回答1:这种问题建议查看Spring官方文档WebAsyncManager http://docs.spring.io/spring/...
中间有一段:
The central class for managing asynchronous request processing, mainly intended as an SPI and not typically used directly by application classes.
意思是主要用来管理异步请求的处理。什么时候要用到异步处理呢?就是业务逻辑复杂(或者其他原因),为了避免请求线程阻塞,需要委托给另一个线程的时候。
标签:
java
相关文章:
1. 网页爬虫 - python requests爬虫问题2. python - 多态调用方法时却显示bound method...3. 请教使用PDO连接MSSQL数据库插入是乱码问题?4. java - 接口中的成员变量怎么不是常量了?5. html5 - html2canvas生成的图片,checkbox和radio的选中项无法截图。6. javascript - canvas压缩图片的原理是什么7. python - 请教这个页面中的这两个信息能否不用无头浏览器爬取到?8. phpstudy 发现多个后门木马,有人遇到过吗?9. transform - css3 translate 的水平垂直居中问题求解10. bindClass方法运行报错
排行榜

网公网安备