jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [servlet-spec users] Re: Re: PushBuilder

From: Mark Thomas <markt_at_apache.org>
Date: Tue, 8 Mar 2016 10:32:34 +0000

On 08/03/2016 08:54, Mark Thomas wrote:
> On 08/03/2016 05:40, Stuart Douglas wrote:
>>
>>
>> ----- Original Message -----
>>> From: "Paul Benedict" <pbenedict_at_apache.org>
>>> To: jsr369-experts_at_servlet-spec.java.net
>>> Sent: Tuesday, 8 March, 2016 8:10:01 AM
>>> Subject: [jsr369-experts] Re: [servlet-spec users] Re: Re: PushBuilder
>>>
>>> Personally, I think ISE is always preferable to silently doing nothing.
>>> Otherwise, the contract of the method needs to change so that users know
>>> it's permissible to discard the operation, in essence, because push() has
>>> the chance to do nothing. I'd rather know of the illegal state.
>>>
>>> Cheers,
>>> Paul
>>
>> This would essentially mean that from a users point of view that no matter what they do this method may sometimes throw an ISE, which I don't think is a great API.
>>
>> I think using the return value of the push() method to determine if the push suceeded would be better, as in general the user code should not really care if the push succeeds or fails by this point anyway.
>
> That would work for me.
>
> isPushSupported() can be used to avoid unnecessary work if desired
>
> push() tells them if it actually got sent (if they care)

I've implemented this for the next Tomcat 9 milestone. I'll bring any
feedback we receive back here.

Mark