twuni/common-net-http — Issue #1: Support for streaming requests and responses.
Author: twuni
Created: 2011-11-23 22:17:10+00:00
State: open

Whenever a request comes in, its body may contain an arbitrarily large amount of data. If this exceeds the amount of memory available to the Java VM, then the application will crash to to an `OutOfMemoryError`. Likewise, the response may contain an amount of data sufficient to crash the application.

This could be remedied by supporting streaming request and response bodies. This is a paradigm shift from the way the server is implemented now, and may result in some drastic changes to the API. Namely:

* The body of a `Request` might be represented as an `InputStream`.
* The body of a `Response` might be represented as an `OutputStream`.
* There might be tighter integration between the `Worker` thread and the designated `Responder`(s).