- assigned_to: nobody --> caplet
The Java io stream abstractions (Reader/Writer for
text, InputStream/OutputStream for binary) are defined
to block (waiting for more input or enough output
buffer). In E, of course, we need to avoid blocking the
vat, so we need to provide non-blocking versions of
these that can wrap and conforming implementation of
these Java types. Of course, the natural way to do this
is to provide eventual variants of normal stream
operations, which return promises which resolve once
the queued operation completes.
Complicating the picture is that we should also accept
normal immediate requests, if these requests can be
fulfilled promptly. To determine promptness and avoid
blocking, we can only use the calls provided by these
Java types. InputStream.available() is perfect.
Unfortunately, Reader.ready() only tells us about the
next character. If we're also folding "\r\n" into "\n"
at the same time (as we should by default), we need to
be very careful not to block.
http://www.erights.org/javadoc/org/erights/e/elib/eio/TextReader.html
and
http://www.erights.org/javadoc/org/erights/e/elib/eio/NonBlockingInputStream.html
are placeholders for needed classes.