> I would like to add two methods to the CompletionHandler:
>
>
> Invoked when an operation fails like when the client close the
> connection or an I/O operation cannot be processed (ex: slow write
> on slow network)
>
> void failed(Throwable t, E result)
>
>
> Invoked when an operation is canceled by invoking the Future.cancel
> method.
>
> void canceled(E result)
>
> Also, what's the difference between completed vs updated? Is updated
> means an I/O operation was performed (but not yet completed
> entirely), like writing a ByteBuffer (to answer myself, I think the
> answer is yes :-)).
yes :)
>
>
> If we support the updated() method, I really think we need to
> support failed/canceled as we have no way to (1) cancel the
> operation (2) get notified when an I/O operations fail.
>
> What do you think?
Currently completed method is called, when operation is getting
completed, cancelled, timed out... We pass future to the completed
method, and using this future object it's possible to get the state of
async operation:
future.isCancelled();
future.isDone();
.....
I implemented it similar to what openJDK had, but I see, that they
recently changed CompletionHandler to what you propose. Actually,
agree, we can do the same.
WBR,
Alexey.
>
> Good idea.
>
>
>
> Thanks
>
> -- Jeanfrancois
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>
>