mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: NIO channel "commands" or something mad like that....
Date Thu, 01 Jun 2006 13:12:56 GMT
It seems like a great idea! Though, just like you say, there would 
probably be some issues which we need to sort out. Add it to JIRA.

BTW, have you had a look at the StreamWriteFilter? It doesn't do exactly 
what you want but it could be helpful if you want to write the contents 
of a file.


Irving, Dave wrote:
> Hi,
> Just brainstorming really, but here's the deal...
> Suppose I want to transfer the contents of a file through mina.
> Right now, I have to do this directly by reading in the file and writing
> it out through the session.
> However, what would be nice would be if I could make use of
> FileChannel#transferTo(WritableByteChannel,...).
> How cool would that be?
> But, of course, there are write ordering issues and such like. So even
> if I could grab hold of the channel somehow, I couldn't just transfer to
> it - as mina might already be doing some queued writes.
> So Im thinking maybe something like a channel "command" or something?
> session.perform(SomeKindOfChannelCommand);
> Mina queues it, just like a write, and then invokes it when its time
> comes.
> Obviously a lot more thought would be needed on this (e.g. what
> "SomeKindOfchannelCommand" actually looks like, what the invocation
> semantics are - blocking / non blocking etc).
> Any thoughts? Is this just a stupid idea....?
> Dave

View raw message