jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Proposal draft for the JAX-RS server-side asynchronous request processing API

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 05 Aug 2011 14:10:14 -0400

All your Ctx initiated suspend examples should probably suspend the
context *before* you submit the task. Otherwise there is a race
condition between the suspend() call and the thread doing the resume().
  Might want to have doco stating that that is required.


Also, question: Can AsyncContext take a Response object too as a
parameter? Also, if a non-Response object is the parameter, how will
JAX-RS know what media type the object is when it marshalls it? From a
@Produces annotation? (ya, that's obvious, just making sure.)


On 8/5/11 12:25 PM, Marek Potociar wrote:
> Hello *,
>
> Based on the recent discussion in the EG, I have checked in a proposed API code including a couple of sample resources
> to demonstrate the intended usage:
>
> http://java.net/projects/jax-rs-spec/sources/git/revision/e8a964aaa0e8af2febd551660d07df3bbb903bcc
>
> Based on the EG feedback, I have focused on simplicity and addressing the most basic scenarios. The API consists of
> @Suspend method-level annotation and AsyncContext interface.
>
> Please review the examples to see how the API is supposed to be used:
>
> http://java.net/projects/jax-rs-spec/sources/git/content/src/examples/src/main/java/jaxrs/examples/async/LongRunningAsyncOperationResource.java
>
> http://java.net/projects/jax-rs-spec/sources/git/content/src/examples/src/main/java/jaxrs/examples/async/AsyncEventResource.java
>
> Looking forward to your feedback.
>
> Kind regards,
> Marek

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com