java - What are the application scenarios of WebAsyncManager in Spring?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-17 09:59:17
0
1
674

Description: The first picture is the processRequest method of FrameworkServlet,

question:

(1) WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);

    asyncManager.registerCallableInterceptor(FrameworkServlet.class.getName(), new RequestBindingInterceptor());

What do these two lines of code do?

(2) What problems does WebAsyncManager solve and what scenarios is it used in?

Seniors and masters don’t hesitate to give pointers

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
迷茫

For this kind of problem, it is recommended to check the official Spring documentation
WebAsyncManager http://docs.spring.io/spring/...

There is a paragraph in the middle:

The central class for managing asynchronous request processing, mainly intended as an SPI and not typically used directly by application classes.

It means it is mainly used to manage the processing of asynchronous requests. When should asynchronous processing be used? It is when the business logic is complex (or for other reasons) and in order to avoid blocking the request thread, it needs to be delegated to another thread.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!