users@jax-rs-spec.java.net

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

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Mon, 15 Oct 2012 03:39:55 +0200

On Oct 12, 2012, at 9:36 PM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:

>
> On Oct 12, 2012, at 9:28 PM, Markus KARG wrote:
>
>> Jan,
>>
>> just scanned the public draft of the spec and did not find the word "push" a
>> single time! How did you come to the conclusion that the async API will
>> allow you to implement frequent server pushes ontop of it?
>
> I thought that was one of the motivations behind it and Bill mentions it as one in his Oct 9th talk on Infoq.

FWIW, the original proposal was much more focused on being able to broadcast multiple events possibly over the same connection. See here:

http://java.net/projects/jax-rs-spec/pages/AsyncServerProcessingModel
http://java.net/projects/jax-rs-spec/pages/AsyncServerOverviewSamples

Alas, this was found too complex by some of the experts here and since I was alone in supporting the proposal at that time, I have decided to come up with a much simpler model. At least for this release.

Marek

>
>
>
> Jan
>
>
>>
>> Regards
>> Markus
>>
>>> -----Original Message-----
>>> From: Jan Algermissen [mailto:jan.algermissen_at_nordsc.com]
>>> Sent: Freitag, 12. Oktober 2012 16:11
>>> To: jsr339-experts_at_jax-rs-spec.java.net
>>> Subject: [jsr339-experts] Re: How are suspended responses usually
>>> managed?
>>>
>>>
>>> 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
>>
>>
>