users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: How are suspended responses usually managed?

From: Markus KARG <markus_at_headcrashing.eu>
Date: Fri, 12 Oct 2012 21:35:49 +0200

Jan,

why do you think that there must be any "parking" thread? If your JAX-RS
resource starts a different thread (see the Executor examples in the public
draft of the spec) then nothing is "waiting" but that thread simply executes
your code and sends back your response by directly invoking the response's
resume() method. No need to park anything unless you use blocking APIs. If
you mean "being blocked" by "parked", then what is being blocked is either
your own thread (if you started one) or the request thread (that's why you
should start one to allow other requests to be processed in the meantime /
In the @Asynchronous case, the Java EE server will provide that thread, but
this has nothing to do with JAX-RS's own mechanics).

Regards
Markus

> -----Original Message-----
> From: Bill Burke [mailto:bburke_at_redhat.com]
> Sent: Freitag, 12. Oktober 2012 15:49
> To: jsr339-experts_at_jax-rs-spec.java.net
> Subject: [jsr339-experts] Re: How are suspended responses usually
> managed?
>
>
>
> On 10/12/2012 9:38 AM, Jan Algermissen wrote:
> > Hi
> >
> > when a response is suspended by the async API the request handing
> thread is being 'released from duty' and can continue serving requests.
> >
> > So far I understand. What I am not entirely clear about is what
> happens with the suspended response - will these be 'parked' in an
> extra thread? Or will there be one thread for each suspended response?
> >
>
> Its up to you and your application. That's the idea.
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com