spray/spray — pull request #333 by lukiano (2013-06-20 15:36:12+00:00)
Title: Servlet 3.1 support

[Servlet 3.1](http://jcp.org/en/jsr/detail?id=340) builds on ReadListeners and WriteListeners to provide asynchronous non-blocking I/O instead of the asynchronous traditional I/O of Servlet 3.0. See [example 1](https://blogs.oracle.com/arungupta/entry/non_blocking_i_o_using) and [example 2](https://weblogs.java.net/blog/swchan2/archive/2013/04/16/non-blocking-io-servlet-31-example).

Right now the only container that provides Servlet 3.1 support is [Glassfish 4](https://glassfish.java.net/). So the way to test this is to build a WAR file and deploy it on a Glassfish instance. Later there will be embedded Jetty or Tomcat containers. Pretty sure Tomcat 8.

And the most important deal, is it faster than asynchronous traditional I/O ? I haven't done any tests, but I don't think so. And I'm pretty sure that depends on how the container is made. I haven't checked [Glassfish source code](https://java.net/projects/glassfish/sources/svn/show) either. I have to take a look at that.

Still, I think this is a start. I have commented the code as much as I could to make its intentions clear.