dev@grizzly.java.net

[2.0] CompletionHandler new method (failed, canceled)

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 16 Dec 2008 17:45:46 -0500

Salut,

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

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?

Thanks

-- Jeanfrancois