users@jax-rs-spec.java.net

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

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Fri, 12 Oct 2012 16:10:47 +0200

On Oct 12, 2012, at 3:49 PM, Bill Burke wrote:

>
>
> 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.

Ok, yes.

Sorry for being stupid.. but:

- so when I suspend a response without invoking a new thread nothing happens except that a connection is being used
  (meaning that a queue of 1000 responses would use up 1000 connections)

- when I resume the response, the response will be sent in the current thread of execution.

That's simple, but I find the implications not so easy to see at first. Thanks.


What I would love to be able to do is to suspend/resume again. Considering server push, it seems odd that I can have a long running request without resource consumption *until* the first bits of the response are sent. What if I want to send one event every Minute? The initial async doesn't really buy me that much, does it?

(just trying to get my head straight)

Jan



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