From: Yehuda Katz Date: 2011-08-02T08:16:56+09:00 Subject: [ruby-core:38672] Re: [Ruby 1.9 - Bug #5138][Open] Add nonblocking IO that does not use exceptions for EOF and EWOULDBLOCK --20cf307f313aa9483104a979d3d0 Content-Type: text/plain; charset=ISO-8859-1 Yehuda Katz Chief Technologist | Strobe (ph) 718.877.1325 On Mon, Aug 1, 2011 at 4:07 PM, Eric Wong wrote: > Yehuda Katz 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 > Interesting. I like this and will update the patch. > > 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. > No problem. It was mostly an homage to your library, but I'll happily change it to something more semantic. > > -- > Eric Wong > > --20cf307f313aa9483104a979d3d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yehuda Katz
Chief Technologist | Strobe
(ph) 718.87= 7.1325


On Mon, Aug 1, 2011 at 4:07 PM, Eric Won= g <normalpers= on@yhbt.net> wrote:
Yehuda Katz <wycat= s@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<= br> > raising exceptions for these routine cases:

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

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

Interesting. I like this and will update the = patch.
=A0
> The patch contains updates for IO, StringIO, and Ope= nSSL. 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. =A0As the creator of the kgio library, I'= ;d
rather the "kgio" name just die if its ideas are merged into Ruby= .

No problem. It was mostly an homage t= o your library, but I'll happily change it to something more semantic.<= /div>
=A0

--
Eric Wong


--20cf307f313aa9483104a979d3d0--