Hello all,
My question is why is the reading style from an IoSession different from the writing style? The obvious way seems to be:

interface IoSession {
.... ReadFuture read();
   WriteFuture write(Object message);
   ....
}

Where:

interface ReadFuture extends IoFuture {
   Object getMessage();
}

So when I want to read I do:

session.read().addListener(<some handler>);

This is wonderfully symmetric to:

session.write(<the message>).addListener(<some handler>);

In this way the Proactor I/O style is maintained for all I/O rather than just for accept, connect, close and write with read being somewhat different. I take it it was a deliberate choice to use a different style for the reading and I'm curious what drove your design. I scanned the mailing list for a similar question but did not find any (forgive me if I missed it).

Cheers,
Todor Boev

Reply via email to