且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

异步 Servlet 与同步 Servlet

更新时间:2023-12-04 12:30:46

异步 ​​servlet 最大的好处是 HTTP 推送,服务器可以在它选择时将信息返回给客户端,而不是在客户端请求它时.预异步 servlet,这将需要长时间运行的 HTTP 连接,每个连接都绑定一个服务器线程,这是非常低效的.这种新模型将服务器端处理与连接处理分离.

The big thing you get with asynchronous servlets is HTTP push, where the server can fire information back to the client when it chooses to, rather than when the client asks for it. Pre-asynch servlets, this would require long-running HTTP connections which each tied up a server thread, which is very inefficient. This new model decouples the server-side processing from the connection handling.