文章详情页
java - Spring 中的WebAsyncManager 有什么应用场景?
浏览:94日期: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. docker gitlab 如何git clone?2. angular.js使用$resource服务把数据存入mongodb的问题。3. 关于docker下的nginx压力测试4. docker镜像push报错5. 关于Android权限的获取问题,大家遇到过这样的情况嘛?6. 刷新页面出现弹框7. angular.js - angularJs ngRoute怎么在路由传递空字符串及用ng-switch取得8. mysql - 用PHPEXCEL将excel文件导入数据库数据5000+条,本地数据库正常,线上只导入15条,没有报错,哪里的问题?9. android - 项目时间长了,字符串文件strings有的字符串可能是多余的,有没有办法快速检测那些是没用的?10. docker不显示端口映射呢?
排行榜
