Asynchronous processing of Requests by Servlet

前端 未结 2 1847
鱼传尺愫
鱼传尺愫 2021-02-09 16:26

I came across the Asynchronous processing of requests by Servlets, as I was exploring how a NodeJS application and a Java application handles a request.

From what I have

2条回答
  •  一向
    一向 (楼主)
    2021-02-09 16:46

    Yes, in this scenario blocking operation will execute in it's own thread and will be blocking some resources, but your HTTP thread is now free to process some other operations that might be not so time-consuming.

    Your gain of asynchronous processing is ability to continue handling other requests while waiting heavyweight operation response instead of dumb blocking HTTP thread.

提交回复
热议问题