You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Bill Speirs <bi...@gmail.com> on 2011/09/20 20:29:00 UTC

Cancellable

I have just started "porting" my code over to the new protocol handler
stuff for 4.2-alpha2. I'm confused about what should be returned by
the handle() method of a class implementing
HttpAsyncRequestHandler<HttpRequest>. All of the examples simply
return null. The JavaDocs documentation has nothing other than the
cancel method's signature: boolean cancel(). What is the boolean which
is returned by this method? True if the operation was canceled and
false otherwise? When would this ever be called?

Thanks...

Bill-

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Cancellable

Posted by Bill Speirs <bi...@gmail.com>.
OK... that is what I thought, just double-checking.

No better ideas right now, and I think this is a clean design.

Thanks...

Bill-

On Tue, Sep 20, 2011 at 4:13 PM, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Tue, 2011-09-20 at 14:29 -0400, Bill Speirs wrote:
>> I have just started "porting" my code over to the new protocol handler
>> stuff for 4.2-alpha2. I'm confused about what should be returned by
>> the handle() method of a class implementing
>> HttpAsyncRequestHandler<HttpRequest>.
>
> Hi Bill
>
> Please see HTTPCORE-272 for the rationale of returning Cancellable from
> the #handle method
>
> https://issues.apache.org/jira/browse/HTTPCORE-272
>
> If you can think of a more elegant way of modeling notification for a
> long running process of the underlying connection being closed
> prematurely, please do feel free to propose it.
>
>
>>  All of the examples simply
>> return null.
>
> Which is fine if the process does not want to be notified.
>
>
>>  The JavaDocs documentation has nothing other than the
>> cancel method's signature: boolean cancel(). What is the boolean which
>> is returned by this method?
>
> Returns true if the process has been canceled as a result of the method
> call, false otherwise (the process has completed or been canceled
> previously).
>
> I'll update javadocs before BETA1 or GA release the latest.
>
> cheers
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Cancellable

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2011-09-20 at 14:29 -0400, Bill Speirs wrote:
> I have just started "porting" my code over to the new protocol handler
> stuff for 4.2-alpha2. I'm confused about what should be returned by
> the handle() method of a class implementing
> HttpAsyncRequestHandler<HttpRequest>.

Hi Bill

Please see HTTPCORE-272 for the rationale of returning Cancellable from
the #handle method 

https://issues.apache.org/jira/browse/HTTPCORE-272

If you can think of a more elegant way of modeling notification for a
long running process of the underlying connection being closed
prematurely, please do feel free to propose it.  


>  All of the examples simply
> return null.

Which is fine if the process does not want to be notified.


>  The JavaDocs documentation has nothing other than the
> cancel method's signature: boolean cancel(). What is the boolean which
> is returned by this method? 

Returns true if the process has been canceled as a result of the method
call, false otherwise (the process has completed or been canceled
previously).

I'll update javadocs before BETA1 or GA release the latest.

cheers

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org