mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: Why not ReadFuture?
Date Tue, 08 May 2007 10:34:32 GMT
This has been discussed quite recently:

http://www.nabble.com/forum/ViewPost.jtp?post=9957679&framed=y

It would certainly be a nice feature.

/Niklas

Todor Boev wrote:
> 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


-- 
Niklas Therning
www.spamdrain.net


Mime
View raw message