I agree with Mark, IMO the usecase like this (similar to example 1 from
J1 presentation):
/class MyServlet extends HttpServlet {//
// public service(HttpServletRequest request, HttpServletResponse
response) {//
// request.getInputStream().setReadListener(...);//
//response.getOutputStream().setWriteListener(...);//
////
//...............................................//
//
// // wait for result/completion//
// Result result = future.get(timeout, timeunit);//
// }//
//}/
doesn't make sense.
> Mark Thomas: I think it makes sense to limit the NIO APIs to Async and upgrade.
agree, IMO we have to throw IllegalStateException if user tries to
register async listeners outside of Servlet 3.0 Async or Upgrade scope.
WBR,
Alexey.
On 12/03/2012 07:47 PM, Rajiv Mordani wrote:
> Not sure how many of you'll are on the users alias so am moving the
> discussion to the EG mailing list (which the users will also be able
> to see).
>
> There is a thread on tying the new io APIs to async request processing
> APIs (from Servlet 3.0) only on the users alias. My first hunch is
> that it is OK but need to think a little more about
> this. But in the mean time I wanted to get others opinion on the topic.
>
> - Rajiv
>
>
> -------- Original Message --------
> Subject: [servlet-spec users] Re: Relationship between the
> non-blocking API and Servlet 3.0 async processing
> Date: Sat, 01 Dec 2012 16:51:01 +0000
> From: Mark Thomas <markt_at_apache.org>
> Reply-To: users_at_servlet-spec.java.net
> To: users_at_servlet-spec.java.net
>
>
>
> 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.