Yehuda Katz <wycats / gmail.com> wrote:
> Issue #5138 has been reported by Yehuda Katz.
> 
> ----------------------------------------
> Bug #5138: Add nonblocking IO that does not use exceptions for EOF and EWOULDBLOCK
> http://redmine.ruby-lang.org/issues/5138

Btw, I started working on this in
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/36904
but never heard more encouragement so didn't work on it more...

> These exceptions are raised repeatedly in virtually every use of the
> non-blocking methods. This patch adds a pair of methods
> (try_read_nonblock and try_write_nonblock) that have the same
> semantics as the existing methods, but they return Symbols instead of
> raising exceptions for these routine cases:

> * :read_would_block
> * :write_would_block
> * :eof

Why :eof instead of nil?  IO#read already returns nil on EOF

> The patch contains updates for IO, StringIO, and OpenSSL. The updates
> are fully documented and tested.

Cool.

The variable name of "kgio" has no context/meaning in your patch,
especially as the years go on.  As the creator of the kgio library, I'd
rather the "kgio" name just die if its ideas are merged into Ruby.

-- 
Eric Wong