文章详情页
java - Spring 中的WebAsyncManager 有什么应用场景?
浏览:124日期: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. angular.js - JS或者angular如何写递归呢?2. javascript - 写移动端的页面的时候,有不一快空白,是怎么回事?3. python - 搜索大文件(20G左右)4. javascript - weex和node,js到底是怎样一个关系呢?5. Android 关于图片压缩的问题。6. python - 两千万条结构化数据怎么进行数据分析7. javascript - 小米浏览器中,图片导致fixed定位的元素无法显示8. 用tp5框架写sql语句9. 为什么要使用javascript函数包装器(添加在coffeescript中)“。call(this)”10. Android-studio导入.so库问题?
排行榜
