On a related note, I'm naively considering a move to a semi-synchronous architecture for my project and have been wondering whether MINA and specifically StreamIOHandler are a good fit.

Specifically, I have a lot of code that expects to use InputStreams, but parts of my code also spend a lot of time waiting for external systems to do their business, during which time I'd prefer not to have useful threads blocked waiting for them. I was thinking I could extend StreamIOHandler with a "streaming" flag. If the streaming flag were set, likely because someone had asked for an InputStream and not closed it yet, I would fire any received data into the Piped*Stream pairs, and if not, I would take a more event-driven approach to handling the block.

Does this sound reasonable?

Thanks,

-0xe1a

Reply via email to