users@servlet-spec.java.net

[servlet-spec users] Re: Relationship between the non-blocking API and Servlet 3.0 async processing

From: Mark Thomas <markt_at_apache.org>
Date: Sat, 01 Dec 2012 16:51:01 +0000

On 30/11/2012 23:11, Shing Wai Chan wrote:
> NonBlocking IO is different from Async IO here.
> In our JavaOne presentation, we do try to put Async and Non Blocking IO
> together.
> You can take a look at Example 3 of the Non-blocking IO in the
> presentation below
> https://blogs.oracle.com/swchan/entry/javaone_2012_what_s_new


I can see the point of supporting NIO with the HTTP upgrade mechanism.
I can see the point of supporting NIO with Servlet 3 Async.

What I don't see is the point of supporting non-blocking IO in a
traditional / synchronous servlet. The container thread is allocated
until the response is completed so there is no benefit in use NIO to
read the request body, nor to write the response body.

I think it makes sense to limit the NIO APIs to Async and upgrade.

Mark