I'm not sure you understand what Async HTTP is for. It is used for
Server-side push. In other words, the client does a long poll to the
server waiting for the server to be ready to send it an event. i.e. a
stock quote update, or a chat message. You want to detach the
HttpResponse from a thread so that one server-side thread can dispatch
to usually more than one HttpResponse.
Your proposal doesn't address this use case at all, IMO.
IMO, Async HTTP is way overhyped and we should only offer minimal
support for it. It is solely a performance feature that became an
issue, IMO, because of the older Linux kernels where threads were so
heavyweight. Now this isn't so much an issue with modern kernels and
hardware. Other languages, i.e. Erlang, scale better as they
automatically suspend threads and do their own internal context
switching.
We want first and foremost to provide the ability to detach a response
from a thread and a mechanism to handle the response asynchronously
*however* the application code.
Alternatively, we could provide a lightweight message bus, i.e. via the
Atmosphere apis, but, IMO, this is a bonus, not a requirement.
On 7/30/11 5:16 AM, Markus KARG wrote:
> I was asked to put my simplified async proposal in the wiki so experts
> can better understand and discuss it.
>
> So here it is:
> http://java.net/projects/jax-rs-spec/pages/SimplifiedAsyncSupport
>
> Please post comments in this mailing list. :-)
>
> To sum up a few points from previous discussions:
>
> * Broadcast and Pub/Sub is not part of the proposal, but should be
> simple to implement ontop.
>
> * No more need for polling or suspending, due to an updated attempt
> (using Callable instead of Future).
>
> * Should be the most simple to learn and apply for programmers, as there
> is either nothing to learn (Callable) or just one annotation to add
> (@Async).
>
> * Should be rather easy to implement for JAX-RS implementation vendors,
> but opens a lot of possibilities for them like applying work stealing etc).
>
> -Markus
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com