3 ms·
I wish the author had considered middleware components written with Netty -- they are async and highly concurent as well. Moreover, Servlet 3.1 Specification
by manishsharan 13y ago
I wish the author had considered middleware components written with Netty -- they are async and highly concurent as well.
Moreover, Servlet 3.1 Specification , which is a part of Java EE7, includes JSR-340 Non-blocking I/O. In a typical application , ServletOutputStream and InputStream do read/write in a while loop while holding on to the request thread. This issue is potentially resolved in Servet 3.1 by adding event listeners – ReadListener and WriteListener interfaces. These are then registered using ServletInputStream.setReadListener and ServletOutputStream.setWriteListener. The listeners have callback methods that are invoked when the content is available to be read or can be written without blocking.
The new versions of Glassfish and Tomcat servers already support Servlet 3.1.
So Java already supports async style web applications. The programmers have to brush up their skills.