From: Yehuda Katz Date: 2011-08-02T09:27:32+09:00 Subject: [ruby-core:38683] Re: [Ruby 1.9 - Bug #5138][Open] Add nonblocking IO that does not use exceptions for EOF and EWOULDBLOCK --20cf307f313a06a0d704a97ad066 Content-Type: text/plain; charset=ISO-8859-1 Yehuda Katz Chief Technologist | Strobe (ph) 718.877.1325 On Mon, Aug 1, 2011 at 5:08 PM, Eric Wong wrote: > Yehuda Katz wrote: > > On Mon, Aug 1, 2011 at 4:07 PM, Eric Wong wrote: > > > Yehuda Katz wrote: > > > > * :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. > > I'm also curious about :*_would_block vs the :wait_*able names used by > kgio. I picked :wait_*able for kgio since the IO::Wait*able name is > already used by Ruby 1.9.2+ exceptions, so it's less of a jump. > I picked *_would_block based on the C EWOULDBLOCK errno, but I'd be happy to change it to match the Ruby 1.9.x exception names. I personally am a bit confused by those names (not sure what the WaitReadable adjective would mean), but it *is* the name, so I'll gladly go with it. > I feel less strongly about these than nil for EOF, though it might help > with porting any kgio-using apps to newer code. > That's good enough for me. > > -- > Eric Wong > > --20cf307f313a06a0d704a97ad066 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 5:08 PM, Eric Won= g <normalpers= on@yhbt.net> wrote:
Yehuda Katz <wycat= s@gmail.com> wrote:
> On Mon, Aug 1, 2011 at 4:07 PM, Eric Wong <normalperson@yhbt.net> wrote:
> > Yehuda Katz <wycats@gmail.= com> wrote:
> > > * :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.

I'm also curious about :*_would_block vs the :wait_*able names us= ed by
kgio. =A0I picked :wait_*able for kgio since the IO::Wait*able name is
already used by Ruby 1.9.2+ exceptions, so it's less of a jump.

I picked *_would_block based on the C EWOULDBL= OCK errno, but I'd be happy to change it to match the Ruby 1.9.x except= ion names. I personally am a bit confused by those names (not sure what the= WaitReadable adjective would mean), but it *is* the name, so I'll glad= ly go with it.
=A0
I feel less strongly about th= ese than nil for EOF, though it might help
with porting any kgio-using apps to newer code.

That's good enough for me.
=A0

--
Eric Wong


--20cf307f313a06a0d704a97ad066--