What's the purpose of AsyncContext.start(…) in Servlet 3.0?

后端 未结 4 2104
[愿得一人]
[愿得一人] 2020-12-12 23:29

Servlet API says about \"AsyncContext.start\":

void start(java.lang.Runnable run)

Causes the container to dispatch a thread, possibly from

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 00:02

    Tomcat ThreadPoolExecutor based on java.util.concurrent.ThreadPoolExecutor and configured in Apache Tomcat 8 Configuration Reference. It handles all Tomcat request, so, if you have long running task its better to handle them in own small-size Fixed/Cached thread pool and submit task like described here.

提交回复
热议问题